/** * Outputs excerpt for an activity embed item. * * @since 2.6.0 */ function bp_activity_embed_excerpt($content = '') { echo bp_activity_get_embed_excerpt($content = ''); }
/** * Sets a custom <blockquote> for our oEmbed fallback HTML. * * @since 2.6.0 * * @param int $item_id The activity ID. * @return string */ protected function set_fallback_html($item_id) { $activity = new BP_Activity_Activity($item_id); $mentionname = bp_activity_do_mentions() ? ' (@' . bp_activity_get_user_mentionname($activity->user_id) . ')' : ''; $date = date_i18n(get_option('date_format'), strtotime($activity->date_recorded)); // Make sure we can use some activity functions that depend on the loop. $GLOBALS['activities_template'] = new stdClass(); $GLOBALS['activities_template']->activity = $activity; // 'wp-embedded-content' CSS class is necessary due to how the embed JS works. $blockquote = sprintf('<blockquote class="wp-embedded-content bp-activity-item">%1$s%2$s %3$s</blockquote>', bp_activity_get_embed_excerpt($activity->content), '- ' . bp_core_get_user_displayname($activity->user_id) . $mentionname, '<a href="' . esc_url(bp_activity_get_permalink($item_id)) . '">' . $date . '</a>'); // Clean up. unset($GLOBALS['activities_template']); /** * Filters the fallback HTML used when embedding a BP activity item. * * @since 2.6.0 * * @param string $blockquote Current fallback HTML * @param BP_Activity_Activity $activity Activity object */ return apply_filters('bp_activity_embed_fallback_html', $blockquote, $activity); }