BP_Core_oEmbed_Extension::content_buffer_end( string $name )
End object buffer.
Description
We’re going to override WP’s get_template_part( ’embed, ‘content’ ) call and inject our own template for BuddyPress use.
Parameters
- $name
-
(Required) Template name.
Source
File: bp-core/classes/class-bp-core-oembed-extension.php
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | public function content_buffer_end( $name ) { if ( 'embed' !== $name || is_404() ) { return ; } // Wipe out get_template_part( 'embed, 'content' ). ob_end_clean(); // Start our custom BuddyPress embed template! echo '<div ' ; post_class( 'wp-embed' ); echo '>' ; // Template part for our embed header. bp_get_asset_template_part( 'embeds/header' , bp_current_component() ); /** * Inject BuddyPress embed content on this hook. * * You shouldn't really need to use this if you extend the * {@link BP_oEmbed_Component} class. * * @since BuddyPress 2.6.0 */ do_action( 'bp_embed_content' ); // Template part for our embed footer. bp_get_asset_template_part( 'embeds/footer' , bp_current_component() ); echo '</div>' ; } |
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.