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

WordPress Trac noreply at wordpress.org
Tue Sep 22 05:58:01 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  |     Focuses:
-------------------------------+-----------------------------
Changes (by peterwilsoncc):

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


Comment:

 This was discussed in a triage session today and moved to the Embed
 component as a result.

 I suspect the reason only width and height are supported are due to the
 oembed spec, specifically the section on consumer requests:

 > Requests sent to the API endpoint must be HTTP GET requests, with all
 arguments sent as query parameters. All arguments must be urlencoded (as
 per RFC 1738).
 >
 > The following query parameters are defined as part of the spec:
 >
 > url (required)
 > The URL to retrieve embedding information for.
 >
 > maxwidth (optional)
 > The maximum width of the embedded resource. Only applies to some
 resource types (as specified below). For supported resource types, this
 parameter must be respected by providers.
 >
 > maxheight (optional)
 > The maximum height of the embedded resource. Only applies to some
 resource types (as specified below). For supported resource types, this
 parameter must be respected by providers.
 >
 > format (optional)
 > The required response format. When not specified, the provider can
 return any valid response format. When specified, the provider must return
 data in the request format, else return an error (see below for error
 codes).
 >
 > Providers should ignore all other arguments it doesn't expect. Providers
 are welcome to support custom additional parameters.

 With the exception of a few embed types, WP passes the data on to the
 provider to return the expected HTML. Accepting IDs and classes within
 WordPress would be possible but not often respected by providers.

 I'll leave this open for now rather than closing it outright so someone
 else with further knowledge of embeds can provide some thoughts.

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


More information about the wp-trac mailing list