BuddyDev

Search

CPT doesn’t appear in activity filter

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

    My activity filter provides several options like groups, memberships, updates etc. but it doesn’t mention new posts from a cpt I added. How can I fix that?

    This is my code used to create this cpt:

        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(
            'action_id'                         => 'new_diary',
            'bp_activity_admin_filter'          => __( 'Published a new diary', 'custom-textdomain' ),
            'bp_activity_front_filter'          => __( 'Diary', 'custom-textdomain' ),
            'bp_activity_new_post'              => __( '%1$s posted a new <a href="%2$s">diary</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'           => __( '%1$s posted a new <a href="%2$s">diary</a>, on the site %3$s', 'custom-textdomain' ),
            'contexts'                          => array( 'activity', 'member' ),
            'activity_comment'                  => true,
            'comment_action_id'                 => 'new_diary_comment',
            'bp_activity_comments_admin_filter' => __( 'Commented a diary', 'custom-textdomain' ),
            'bp_activity_comments_front_filter' => __( 'Diary Comments', 'custom-textdomain' ),
            'bp_activity_new_comment'           => __( '%1$s commented on the <a href="%2$s">diary</a>', 'custom-textdomain' ),
            'bp_activity_new_comment_ms'        => __( '%1$s commented on the <a href="%2$s">siary</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                          => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );
  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #36734

    However the cpt appears in the general activity filter, but not in the profile activity feed.

You must be logged in to reply to this topic.

This topic is: not resolved