Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP show filter and Custom Post Type


  • ineedyou
    Participant

    @ineedyou

    Hi,

    I am just copypaste code user – just simple user and need someone to help me. Please. I found below code, i am adding to bp-custom its working. But i need to extend this code, if i want to add second or more custom post type, how will i do? I read lots of article , try to solve 2 days but i cant. Try it 100 different version but no no no….Can anyone can show me how to add moe than one… Thanks and sorry my bad English..

    
    <?php
    add_post_type_support( ‘book’, ‘buddypress-activity’ );
    function customize_page_tracking_args() {
    
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( ‘activity’ ) ) {
            return;
        }
        bp_activity_set_post_type_tracking_args( ‘book’, array(
            ‘component_id’             => ‘activity’,
            ‘action_id’                => ‘new_book’,
            ‘bp_activity_admin_filter’ => __( ‘My Book’, ‘custom-domain’ ),
            ‘bp_activity_front_filter’ => __( ‘Book’, ‘custom-domain’ ),
            ‘contexts’                 => array( ‘activity’, ‘member’ ),
            ‘bp_activity_new_post’     => __( ‘%1$s published <a href="”%2$s”">Book Suggest</a>’, ‘custom-textdomain’ ),
    
            ‘bp_activity_new_post_ms’  => __( ‘%1$s published <a href="”%2$s”">Book</a>, on the site %3$s’, ‘custom-textdomain’ ),
    ‘comment_action_id’                 => ‘new_book_comment’,
            ‘bp_activity_comments_admin_filter’ => __( ‘Commented Book’, ‘custom-textdomain’ ),
            ‘bp_activity_comments_front_filter’ => __( ‘Book Comments’, ‘custom-textdomain’ ),
            ‘bp_activity_new_comment’           => __( ‘%1$s commented on the <a href="”%2$s”">Book</a>’, ‘custom-textdomain’ ),
            ‘bp_activity_new_comment_ms’        => __( ‘%1$s commented on the <a href="”%2$s”">Book</a>, on the site %3$s’, ‘custom-textdomain’ ),
            ‘position’                          => 100,
           ) );
    }
    add_action( ‘init’, ‘customize_page_tracking_args’, 1000 );
     ?>
  • You must be logged in to reply to this topic.
Skip to toolbar