bp_get_activity_feed_item_title()

Return the activity feed item title.

Description

Return

(string) $title The activity feed item title.

Source

File: bp-activity/bp-activity-template.php

3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
function bp_get_activity_feed_item_title() {
    global $activities_template;
 
    if ( !empty( $activities_template->activity->action ) ) {
        $content = $activities_template->activity->action;
    } else {
        $content = $activities_template->activity->content;
    }
 
    $content = explode( '<span', $content );
    $title   = strip_tags( ent2ncr( trim( convert_chars( $content[0] ) ) ) );
 
    if ( ':' === substr( $title, -1 ) ) {
        $title = substr( $title, 0, -1 );
    }
 
    if ( 'activity_update' === $activities_template->activity->type ) {
        $title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " [&#133;]" ) ) ) ) ) );
    }
 
    /**
     * Filters the activity feed item title.
     *
     * @since BuddyPress 1.0.0
     *
     * @param string $title The title for the activity feed item.
     */
    return apply_filters( 'bp_get_activity_feed_item_title', $title );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

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.