Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Add an activity entry when friend publish a post


  • marcelo2605
    Participant

    @marcelo2605

    I’m using bp_activity_set_post_type_tracking_args to add entries in user Activity tab every time he publish a post.

    But how can I add the same entry on his friends activity tabs?

    Here is my code:

    add_post_type_support( 'stories', 'buddypress-activity' );
    
    add_action( 'init',  function() {
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
    
        bp_activity_set_post_type_tracking_args( 'stories', array(
            'bp_activity_admin_filter' => __( 'Published a new story', 'buddypress' ),
            'bp_activity_front_filter' => __( 'Stories', 'buddypress' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">story/chapter</a>', 'buddypress' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">story/chapter</a>', 'buddypress' ),
            'position'                 => 100,
        ) );
    });
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Add an activity entry when friend publish a post’ is closed to new replies.
Skip to toolbar