[wp-trac] [WordPress Trac] #37751: Incorrect $format passed to the oembed_endpoint_url filter

WordPress Trac noreply at wordpress.org
Sat Aug 20 17:35:03 UTC 2016


#37751: Incorrect $format passed to the oembed_endpoint_url filter
--------------------------+----------------------------------------
 Reporter:  swissspidy    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7
Component:  Embeds        |    Version:  4.4
 Severity:  normal        |   Keywords:  needs-patch good-first-bug
  Focuses:  docs          |
--------------------------+----------------------------------------
 In `get_oembed_endpoint_url()`. `$format` is set to `false` when JSON is
 passed as the format.

 This is done so that the JSON format (which is the default) isn't
 unnecessarily appended to the URL.

 However, when using the `oembed_endpoint_url` filter, `$format` is always
 `false` in that case. The filter docs state a string is passed, so this is
 unexpected behaviour.

 The `add_query_arg()` part should be changed to read something like
 `format' => ( 'json' === $format ) ? false : $format,`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37751>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list