[wp-trac] [WordPress Trac] #41403: Support "class" and "id" attributes on wp_oembed_get()

WordPress Trac noreply at wordpress.org
Tue Sep 22 13:52:44 UTC 2020


#41403: Support "class" and "id" attributes on wp_oembed_get()
--------------------------------------------+-----------------------------
 Reporter:  ramiy                           |       Owner:  (none)
     Type:  defect (bug)                    |      Status:  new
 Priority:  normal                          |   Milestone:  Future Release
Component:  Embeds                          |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  needs-patch close dev-feedback  |     Focuses:
--------------------------------------------+-----------------------------
Changes (by ramiy):

 * keywords:  needs-patch close => needs-patch close dev-feedback


Comment:

 @peterwilsoncc Thank you for clarifying that. But I think we can overcome
 this by adding a new parameter for for the **container div** wrapping the
 oEmbed provider html.

 The `wp_oembed_get( $url, $args, $container )` function will check if
 `$container` is not empty, then a container will wrap the oEmbed html with
 custom Classes, IDs, Titles, aria-* tags, data-* tags and other attributes
 the developer want to put around the oEmbed code.

 Another solutions is to filter the`wp_oembed_get()` returned value. This
 way developers can add container divs.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41403#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list