• Resolved gebeer

    (@gebeer)


    Hello,
    in the Optional API query-string params setting we have iframe=card.
    Now we have the case where we need to get the standard embed code with wp_oembed_get($url, $args) function in our code.
    Since Iframely is intercepting this call, there is no chance to get a standard embed code like we would get with the setting iframe=0.

    We tried remove_all_filters() for all of the filters that are being added in iframely.php. To no avail. Also tried disabling caching.

    How can we make wp_oembed_get() return standard embed code when the setting for Optional API query-string params is iframe=card and the setting Don’t override default embed providers is not checked?

    • This topic was modified 3 years, 2 months ago by gebeer.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gebeer

    (@gebeer)

    Solved by removing filter ‘oembed_providers’ before executing wp_oembed_get($url)

        remove_filter('oembed_providers', 'maybe_reverse_oembed_providers');
        $embedCode = wp_oembed_get($url);
        // var_dump($embedCode);
        add_filter('oembed_providers', 'maybe_reverse_oembed_providers');
    
    Plugin Author Ivan Paramonau

    (@ivanp)

    Great, thanks! Your code should work well for the use case.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable from Code before calling wp_oembed_get’ is closed to new replies.