BuddyBoss Home – Web Support Forums Solutions Social Learner Custom post type in Activity stream

Viewing 13 posts - 1 through 13 (of 13 total)
  • Question

    #63033
    @vhankim

    Hello, Boss!

    I want to add the custom post types (eg. product, portfolio, etc..) in activity stream.
    I tried following the ‘Bp Codex _ https://codex.buddypress.org/plugindev/post-types-activities/‘ document.

    But.. Stream is no change..

    Where to add the that code?

    Answers

    #63071

    Anonymous
    @

    Hi @vhankim, Custom post type in Activity stream is now Buddypress default feature you do not need any code to include it in your activity.

    Regards

    #63072
    @vhankim

    Hi @pallavi.

    Um… but why do not appear the woocommerce ‘product’ types??

    How can i setting in?

    #63657

    Anonymous
    @

    Hi @vhankim
    You can add following code to child theme functions.php to add support for WooCommerce

    
    add_post_type_support( 'product', 'buddypress-activity' );
    

    For further details you can check

    Post Types Activities


    Regards
    Varun Dubey

    #63739
    @vhankim

    Hi @vapvarun

    I tried in your way. However, there is no change.

    #63806

    Anonymous
    @

    Hi @vhankim

    to display inside filter dropdown, you will added to add additional arguments

    
    function customize_product_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( 'product', array(
            'component_id'             => buddypress()->blogs->id,
            'action_id'                => 'new_product',
            'bp_activity_admin_filter' => __( 'Published a new product', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Products', 'boss' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">product</a>', 'boss' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">product</a>, on the site %3$s', 'boss' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_product_tracking_args' );
    
    
    #63948
    @vhankim

    Hi @vapvarun.

    I tried but not change anything…

    custom post types(product and page, etc..) not appear in stream, dropdown menu..

    #63967

    Anonymous
    @

    Hi @vhankim

    To add Product

    
    add_post_type_support( 'product', 'buddypress-activity' );
    function customize_product_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( 'product', array(
            
            'action_id'                => 'new_product',
            'bp_activity_admin_filter' => __( 'Published a new product', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Products', 'boss' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">product</a>', 'boss' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">product</a>, on the site %3$s', 'boss' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_product_tracking_args' );
    

    To add page

    
    add_post_type_support( 'page', '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( 'page', array(
            
            'action_id'                => 'new_blog_page',
            'bp_activity_admin_filter' => __( 'Published a new page', 'boss' ),
            'bp_activity_front_filter' => __( 'Pages', 'boss' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">page</a>', 'boss' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">page</a>, on the site %3$s', 'boss' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );
    
    

    http://screencast-o-matic.com/watch/cDeqhb13NF
    You can also check with BuddyPress support

    BuddyPress support forum: https://buddypress.org/support/

    Post Types Activities

    Regards
    Varun Dubey

    #63972
    @vhankim

    Hi. @vapvarun

    I’ve tried your way.
    First, the drop-down menu in the activity profile page looks good.
    However, the stream function does not work.

    Then, the stream does not apply and the drop-down menu in the overall site activity stream.

    #63974

    Anonymous
    @

    Hi @vhankim

    It will be better You check with BuddyPress support, These are beyond theme support.

    Regards
    Varun Dubey

    #63987
    @vhankim

    Hi @vapvarun.

    I was checked the theme. When activated boss-child & Social-learner, stream and drop-down menu works well in user’s activity page.
    However, stream & menu not work in overall site activity page.

    When activated twentysixteen theme, all works well.

    #64102
    @vhankim

    I did it! 🙂

    I was added menu code in buddypress > activity > index.php

    #64343

    Anonymous
    @

    Great 🙂
    Regards

Viewing 13 posts - 1 through 13 (of 13 total)
  • The question ‘Custom post type in Activity stream’ is closed to new replies.