BuddyDev

Search

[Buddyblog Pro] Custom post type and comments don’t appear in activity stream

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #38726

    I created a custom post type “Diary” to use with Buddyblog Pro. It works well, except that the new posts nor the comments appear in the activity stream.

    This is what I added to bp-custom.php:

    
        // Don't forget to add the 'buddypress-activity' support!
        add_post_type_support( 'diary', 'buddypress-activity' );
    
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
    
        /**
         * Also don't forget to allow comments from the WordPress Edit Page screen
         * see this screencap https://cldup.com/nsl4TxBV_j.png
         */
     
        bp_activity_set_post_type_tracking_args( 'diary', array(
            'component_id'                      => 'activity',
            'action_id'                         => 'new_diary',
            'bp_activity_admin_filter'          => __( 'Published a new diary', 'buddypress' ),
            'bp_activity_front_filter'          => __( 'Diary', 'buddypress' ),
            'bp_activity_new_post'              => __( '%1$s posted a new <a href="%2$s">diary</a>', 'buddypress' ),
            'contexts'                          => array( 'activity', 'member' ),
            'activity_comment'                  => false,
            'position'                          => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' ); 
    

    Please help me to fix this.

    • This topic was modified 1 year, 4 months ago by Hugo Callens.
  • Keymaster
    (BuddyDev Team)
    Posts: 21779
    Brajesh Singh on #38728

    Hi Hugo,
    Thank you for using BuddyBlog Pro.
    Please remove the custom code and visit BuddyBlog->Settings->Diary tab and make sure you enable the BuddyPress activity integration.

    Try posting after that and let me know if that works or not?

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #38731

    It works now, thank you!
    Just one more thing: how can I disable comments in the activity feed, so people can’t reply on feed posts but only on the cpt itself?

  • Keymaster
    (BuddyDev Team)
    Posts: 21779
    Brajesh Singh on #38739

    Hi Hugo,
    Thank you for confirming.

    Please disable the commenting option from blog from Dashboard->Settings->BuddyPress->Options page.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #38753

    Hi Brajesh,
    Thank you.
    However I would like to disable feed comments for Diary cpt only, not for the whole activity feed. How can I do that?
    Regards
    Hugo

  • Keymaster
    (BuddyDev Team)
    Posts: 21779
    Brajesh Singh on #38756

    Hi Hugo,
    That option only disables it for post type comments in activity. so, it will disable that for the story as well as any other post type’s comment in activity stream.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #39084

    Hi Brajesh,

    About new posts appearing in the activity stream: it looks like these messages only appear in the personal stream, not in the general stream (I am using Facebook Like User Activity Stream) as they should.

    They do appear in the default BP activity stream, but only my own posts. When I publish a new post it appears in the default activity stream and in the personal stream of my profile. But a post created by someone else doesn’t.

    Please help!

  • Keymaster
    (BuddyDev Team)
    Posts: 21779
    Brajesh Singh on #39088

    Hi Hugo,
    Thank you.

    That depends on whether the post type is public or private. If a post type is private and you have activity integration enabled, It will appear in your personal stream.

    If the post type is public, It will appear in the sitewide stream.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #39112

    Hi Brajesh,

    I checked my Buddyblog settings and can confirm my form is set to public: Enable post visibility = yes,
    Default post visibility = public.
    Nevertheless the posts don’t appear in the activity stream.
    What could be wrong?

    Regards

    Hugo

  • Keymaster
    (BuddyDev Team)
    Posts: 21779
    Brajesh Singh on #39113

    Hi Hugo,
    Thank you for the reply.

    I was referring to your post type. How did you register the post type? Is the post type registered as public or private?

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved