bp_activity_get_embed_excerpt( string $content = '' )

Generates excerpt for an activity embed item.

Description

Parameters

$content

(Optional) The content to generate an excerpt for.

Default value: ''

Return

(string)

Source

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

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
function bp_activity_get_embed_excerpt( $content = '' ) {
    if ( empty( $content ) && ! empty( $GLOBALS['activities_template']->in_the_loop ) ) {
        $content = $GLOBALS['activities_template']->activity->content;
    }
 
    /*
     * bp_activity_truncate_entry() includes the 'Read More' link, which is why
     * we're using this instead of bp_create_excerpt().
     */
    $content = html_entity_decode( $content );
    $content = bp_activity_truncate_entry( $content, array(
        'html' => false,
        'filter_shortcodes' => true,
        'strip_tags'        => true,
        'force_truncate'    => true
    ) );
 
    /**
     * Filter the activity embed excerpt.
     *
     * @since BuddyPress 2.6.0
     *
     * @var string $content Embed Excerpt.
     * @var string $unmodified_content Unmodified activity content.
     */
    return apply_filters( 'bp_activity_get_embed_excerpt', $content, $GLOBALS['activities_template']->activity->content );
}

Changelog

Changelog
Version Description
BuddyPress 2.6.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.