Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Disable Oembed on a certain activity stream?


r-a-y
Keymaster

@r-a-y

The main juice is the filter.

What you’ll want to do is disable the current filter and write a conditional to activate the filter (depending on where you want it to be enabled).

Let’s say you wanted to disable oEmbed from the home page, something like the following will work in your theme’s functions.php:

`remove_filter( ‘bp_get_activity_content_body’, ‘ray_bp_oembed’, 9 );
remove_filter( ‘bp_get_activity_content’, ‘ray_bp_oembed’, 9 );

if( !is_front_page() ) {
// re add the filters
add_filter( ‘bp_get_activity_content_body’, ‘ray_bp_oembed’, 9 );
add_filter( ‘bp_get_activity_content’, ‘ray_bp_oembed’, 9 );
}`

You might have to play around with the conditional to get it right, but hopefully this gives you an idea.

*Word of warning: I’m restructuring the plugin, so these filters will need to change for v0.6.

Skip to toolbar