Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable Oembed on a certain activity stream?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @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.

    Avatar of thelandman
    thelandman
    Participant

    @thelandman

    @r-a-y thanks so much! Worked like a charm.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.