Skip to:
Content
Pages
Categories
Search
Top
Bottom

Comments not showing up on activity stream

Viewing 3 replies - 1 through 3 (of 3 total)

  • Henry Wright
    Moderator

    @henrywright

    Hi @mjc82in

    Go to Settings > BuddyPress > Settings and select “Allow activity stream commenting”


    Manoj Chacko
    Participant

    @mjc82in

    Did do that,

    I also enabled below for pages, but pages dont show up.

    // Add custom post type to activity record
    add_filter ( ‘bp_blogs_record_post_post_types’, ‘activity_publish_custom_post_types’,1,1 );
    // Add custom post type comments to activity record
    add_filter ( ‘bp_blogs_record_comment_post_types’, ‘activity_publish_custom_post_types’,1,1 );

    function activity_publish_custom_post_types( $post_types ) {
    // add any custom post-type here
    $post_types[] = ‘page’;
    return $post_types;
    }


    danbp
    Moderator

    @danbp

    hi @mjc82in,

    BuddyPress is continuously evolving. 2 years back it was a mess trying to use CPT on SWA. That’s no more the case with BP 2.2

    Maybe this example will help you. It creates a CPT called Music which will show up on the SWA where you can comment it.

    Add the code to bp-custom.php

    // allow tracking of our CPT
    add_post_type_support( 'music', '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( 'music', array(
            'component_id'             => 'activity',
            'action_id'                => 'new_music',
            'bp_activity_admin_filter' => __( 'Published a new music', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Music', 'text-domain' ),
    			'contexts'                 => array( 'activity', 'member' ),
    			'activity_comment'         => true,
    			'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">Music</a>', 'text-domain' ),
    			'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">Music</a>, on the site %3$s', 'text-domain' ),
    			'position'                 => 800,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 999 );
    
    function bpfr_create_post_type() {
      register_post_type( 'music',
        array(
          'labels' => array(
            'name' => __( 'Music', 'text-domain' ),
            'singular_name' => __( 'Music', 'text-domain' )
          ),
          'public' => true,
          'has_archive' => true,
        )
      );
    }
    add_action( 'init', 'bpfr_create_post_type' );

    Ref: https://codex.buddypress.org/plugindev/post-types-activities/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Comments not showing up on activity stream’ is closed to new replies.
Skip to toolbar