Embeds
Since BuddyPress 1.5, we have integrated WordPress’ native Embeds functionality.
So now it’s easy to embed videos, images, and other content into your Activity Stream, Group Forum, and Private Message posts.
All you have to do is add your embed URL on its own line in the textarea.
eg.
This is awesome! http://www.youtube.com/watch?v=ROBmgYcIBww
And your content will be automatically embedded!
Frequently Asked Questions
What sites are supported?
See https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F
To embed more sites, you can use any oEmbed plugin for WordPress.
Embedly is a popular choice that supports over 200 sites. For performance issues when using Embedly, select only the sites you need to support.
How do I adjust the width of my embedded items?
If you’re not using the BuddyPress Default theme, you will probably want to customize the width of your embedded items so they match the width of your theme.
There are two ways to resize the width:
- Set the “maximum embed size” in the WP Media Settings Subpanel
- Set the $content_width variable in your theme’s functions.php:
if ( ! isset( $content_width ) ) // Change 640 to whatever the width of your column is $content_width = 640;
Filtering embeds
BP doesn’t use the WordPress embed_oembed_html
filter, but bp_embed_oembed_html
can be used instead. For example:
add_filter( 'bp_embed_oembed_html', function( $html, $url, $attr, $rawattr ) { // Wrap the embed with a <div> tag. $html = '<div class="embed-wrapper">' . $html . '</div>'; return $html; }, 10, 4 );
I’m a developer. How can I find out more about WordPress Embeds?
Read the WordPress codex article:
https://codex.wordpress.org/Embeds#How_Can_I_Add_Support_For_More_Websites.3F
My YouTube video URL doesn’t show up! Why?
If the author of the YouTube video has disallowed embedding, due to privacy reasons, the video will not be embedded.