Opened 8 years ago
Closed 8 years ago
#37751 closed defect (bug) (fixed)
Incorrect $format passed to the oembed_endpoint_url filter
Reported by: | swissspidy | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Embeds | Keywords: | good-first-bug has-patch |
Focuses: | docs | Cc: |
Description
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,
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Patch to check if format is JSON in add_query_arg()