[wp-trac] [WordPress Trac] #51471: pre_oembed_result filter missing from oembed proxy controller
WordPress Trac
noreply at wordpress.org
Wed Oct 7 18:14:51 UTC 2020
#51471: pre_oembed_result filter missing from oembed proxy controller
-----------------------------+-----------------------------
Reporter: Bernhard Reiter | Owner: pento
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Embeds | Version:
Severity: normal | Keywords:
Focuses: rest-api |
-----------------------------+-----------------------------
[https://github.com/WordPress/WordPress/blob/5cee7eced0b691089a875d7e918d4380bac408af
/wp-includes/class-wp-oembed.php#L363-L415 WP_oEmbed::get_html()]
[https://github.com/WordPress/WordPress/blob/5cee7eced0b691089a875d7e918d4380bac408af
/wp-includes/class-wp-oembed.php#L393 applies] the `pre_oembed_result`
filter, allowing it to short-circuit the actual request to the oEmbed
provider's REST API.
That same filter is however missing from
[https://github.com/WordPress/WordPress/blob/5cee7eced0b691089a875d7e918d4380bac408af
/wp-includes/class-wp-oembed-controller.php#L154-L220
WP_oEmbed_Controller::get_proxy_item()]. (Note that both
`WP_oEmbed::get_html()` and `WP_oEmbed_Controller::get_proxy_item()` are
otherwise quite similar, sharing the `get_data()` and `data2html()` calls,
and `oembed_result` filter.)
It's arguable that the oembed REST API endpoint should allow for the same
kind of filtering as the `oEmbed` class.
This issue seems somewhat similar to #45142, which was about the
`oembed_result` filter.
cc @swisspidy @danielbachhuber
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51471>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list