Skip to:
Content
Pages
Categories
Search
Top
Bottom

activity thread displays posts but not comments from custom post type

  • @adam_ohern

    Participant

    Thanks all for the fantastic forum! It’s an amazing resource.

    I have a plugin that creates a custom post type called “lightning_posttype”. In the main plugin PHP file, I have the following:

    add_filter( 'bp_blogs_record_comment_post_types', 'activity_lightning_posts' );
    add_filter( 'bp_blogs_record_post_post_types', 'activity_lightning_posts' );

    Then, in a separate PHP file (required earlier in the main PHP script), I have the following function:

    function activity_lightning_posts($post_types) {
        $post_types[] = 'lightning_posttype';
        return $post_types;
    }

    At this point my posts are showing up in the activity feed perfectly, but the comments are not. I’ve been reading and experimenting for quite some time, but can’t seem to find the magic combo.

    Any hints greatly appreciated!

    Adam

Viewing 2 replies - 1 through 2 (of 2 total)
  • @shanebp

    Moderator

    If you’re using BP 2.2 +, you should use this approach instead:

    Post Types Activities

    My cpts appear.
    However, comments on them do not appear in the activity stream.

    Perhaps because I didn’t create a component for those cpts – I hope that is not the case.
    Hopefully this ticket will provide an answer.

    @adam_ohern

    Participant

    That’s really helpful context, Shane. Many thanks! Too bad about comments not being supported. Seems like something lots of folks would want!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘activity thread displays posts but not comments from custom post type’ is closed to new replies.
Skip to toolbar