Skip to:
Content
Pages
Categories
Search
Top
Bottom

filter for page?

  • Avatar of onyx808
    onyx808
    Member

    @onyx808

    Hello,

    love the plugin, but I have a small widget on my homepage displaying the latest updates from the sitewide activity…
    is there a way to put a filter on the homepage so the plugin doesnt run on this widget only?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of onyx808
    onyx808
    Member

    @onyx808

    Nevermind.. figured out.. adding this code in the actual page where you dont want oembed to work

    $bp_oembed[] = ‘youtube.com’;

    add the code in the php tags and repeat for different site like vimeo and such…

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @onyx808 – FYI, this format is going to change in the next release as I’m phasing out this code. (Bad code by me!). It will be available in a filter instead.

    The better option is to remove the filter entirely when you’re on the homepage:

    `if ( bp_is_front_page() ) {
    remove_filter( ‘bp_get_activity_content_body’, ‘ray_bp_oembed’, 9 );

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

    Try putting that in your theme’s functions.php. Untested.

    Again, this snippet will need to be updated when the next version of the plugin is released as the new version is almost a complete rewrite.

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

You must be logged in to reply to this topic.