Wiki Pro Integration with Buddypress

It would be nice to integrate wiki pro with buddypress.

1. Updates in the activity stream when a user updates a wiki
2. Group wiki functionality
3. A wiki tab on the users buddypress profile

Is this possible with the current version? Is it being considered for future updates?

  • Ash

    Hello @Matthew Sutton

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    1. Updates in the activity stream when a user updates a wiki

    You can use the following code:

    add_action( 'save_post', 'add_wiki_activity_to_bp' );
    function add_wiki_activity_to_bp( $post_id ) {
    	if( get_post_type( $post_id ) == 'incsub_wiki' ) {
    
    		if ( ! function_exists( 'bp_activity_add' ) ) return false;
    
    		$user_id = get_current_user_id();
    		$user_info = get_userdata( $user_id );
    		$post = get_post( $post_id );
    
    		if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) ) {
    			bp_activity_add( array(
    			'user_id' => $user_id,
    			'action' => bp_core_get_userlink( $user_id ) . ' has published <a href="' . get_permalink( $post->ID ) . '">' . $post->post_title . '</a>',
    			'component' => 'profile',
    			'type' => 'created_wiki'
    			) );
    		}elseif( ( $_POST['post_status'] == 'publish' ) ) {
    			bp_activity_add( array(
    			'user_id' => $user_id,
    			'action' => bp_core_get_userlink( $user_id ) . ' has edited <a href="' . get_permalink( $post->ID ) . '">' . $post->post_title . '</a>',
    			'component' => 'profile',
    			'type' => 'created_wiki'
    			) );
    		}
    	}
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    2. Group wiki functionality
    3. A wiki tab on the users buddypress profile

    Both will need lots of custom code and customize the plugin. So, I am marking this as a feature request. Lets see what other members think about this.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.