[wp-trac] [WordPress Trac] #35240: embed_oembed_html filter not used with wp_oembed_get

WordPress Trac noreply at wordpress.org
Mon Dec 28 17:18:11 UTC 2015

#35240: embed_oembed_html filter not used with wp_oembed_get
 Reporter:  theMikeD      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Embeds        |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  template
Changes (by swissspidy):

 * keywords:   => close


 The `embed_oembed_html` filter is specific to the shortcode parsing
 because it's tightly coupled to the post the oEmbed is cached for.
 `WP_Embed::shortcode` itself calls `wp_oembed_get()`.

 `wp_oembed_get()` doesn't depend on any post, therefore we can't use the
 same filter there.

 > A new filter be present in `wp_oembed_get` to enable the same kind of

 Since `wp_oembed_get()` calls `\WP_oEmbed::get_html()`, you can use its
 `oembed_result` filter to modify the response.

Ticket URL: <https://core.trac.wordpress.org/ticket/35240#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list