Page and wiki comments won't show in buddypress activity feed

I'm working on a multisite setup for the local social service community. I can't seem to get page or wiki comments to show up on our buddypress activity feed. Example: This comment on a wiki page doesn't show.

I'd really like wiki activity in particular (new wiki's added, wiki edits, and comments) to be integrated tightly into the activity feeds - it will support a culture of active contributions to the wikis.

Any ideas?

  • DavidM
    • DEV MAN’s Mascot

    Hi philowen and welcome to WPMU DEV!

    Good point, and the following article appears to cover exactly this.
    http://bpdevel.wordpress.com/2011/08/12/custom-post-types-comments-and-the-activity-stream-in-bp-1-5/

    And with that, I believe the following, perhaps added to your theme's stylesheet, should do the trick:
    EDIT: this would be added to functions.php rather than the stylesheet!

    function bbg_record_my_custom_post_type_comments( $post_types ) {
          $post_types[] = 'incsub_wiki';
          return $post_types;
      }
    add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_my_custom_post_type_comments' );

    Let me check with the developer on this to see if that can easily be added to the plugin.

    Thanks,
    David

  • Phil
    • WPMU DEV Initiate

    Thanks David, and thanks for the welcome. WPMU is a really cool service.

    Please forgive me if I am a bit of a noob - still learning a lot about WordPress and messing with PHP is still a little intimidating sometimes. Where do I add the code? Maybe the functions.php sheet? Do I add it on the theme for the core site that has the bp plugin? Is it important where I paste it on the sheet?

    Also, if I want pages and page comments to show, do I copy the same script and swap out 'incsub_wiki' for something else?

  • DavidM
    • DEV MAN’s Mascot

    Hiya Phil,

    I believe you can swap out the above with 'pages' in order for page comments to show, though I haven't tried that one myself.

    And sorry, I mistakenly mentioned adding the above to your theme's stylesheet whereas that would be added to your theme's functions.php file instead!

    Alternatively, you could simply include that above code in a new plugin as follows by adding it right before the ?> in the following:
    http://codex.wordpress.org/Writing_a_Plugin#File_Headers

    With that you can then copy it to your plugins folder and activate it as a plugin. :slight_smile:

    Cheers,
    David

  • Phil
    • WPMU DEV Initiate

    Awesome. I'll give it a try via a new plugin.

    Can the same approach be used for other changes to functions.php? Like registering additional sidebars? Is it common to use plugins to "upgrade-proof" changes to the functions file? Strikes me as super-handy if this is the case.

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.