BBP_BuddyPress_Activity::topic_activity_action_callback( $action,  $activity )

Description

Source

File: bp-forums/activity.php

685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
public function topic_activity_action_callback( $action, $activity ) {
    $user_id  = $activity->user_id;
    $topic_id = $activity->item_id;
    $forum_id = $activity->secondary_item_id;
 
    // User
    $user_link = bbp_get_user_profile_link( $user_id  );
 
    // Topic
    $topic_permalink = bbp_get_topic_permalink( $topic_id );
    $topic_title     = get_post_field( 'post_title',   $topic_id, 'raw' );
    $topic_link      = '<a href="' . $topic_permalink . '">' . $topic_title . '</a>';
 
    // Forum
    $forum_permalink = bbp_get_forum_permalink( $forum_id );
    $forum_title     = get_post_field( 'post_title', $forum_id, 'raw' );
    $forum_link      = '<a href="' . $forum_permalink . '">' . $forum_title . '</a>';
 
    return sprintf(
        esc_html__( '%1$s started the discussion %2$s in the forum %3$s', 'buddyboss' ),
        $user_link,
        $topic_link,
        $forum_link
    );
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.