WP_oEmbed
- Since
- 2.9.0
- Source
wp-includes/class-wp-oembed.php:19
Core class used to implement oEmbed functionality.
Compatibility
- WordPress
- since 2.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 8
Every hook that fires from inside WP_oEmbed, in the order it appears in the class, grouped by the method that fires it.
WP_oEmbed::__construct()
- apply_filters( oembed_providers )filter line 232
WP_oEmbed::get_html()
- apply_filters( pre_oembed_result )filter line 460
- apply_filters( oembed_result )filter line 482
WP_oEmbed::discover()
- apply_filters( oembed_remote_get_args )filter line 509
- apply_filters( oembed_linktypes )filter line 525
WP_oEmbed::fetch()
- apply_filters( oembed_fetch_url )filter line 605
WP_oEmbed::data2html()
- apply_filters( oembed_dataparse )filter line 798
Properties · 3
$providersarray<string,public- A list of oEmbed providers.
$early_providersarraypublic static- A list of an early oEmbed providers.
$compat_methodsarrayprivate- A list of private/protected methods, used for backward compatibility.
Methods · 16
- __construct()Constructor.
- __call()Exposes private/protected methods for backward compatibility.
- sanitize_provider()Sanitizes and normalizes a single oEmbed provider entry.
- get_provider()Takes a URL and returns the corresponding oEmbed provider's URL, if there is one.
- _add_provider_early()Adds an oEmbed provider.
- _remove_provider_early()Removes an oEmbed provider.
- get_data()Takes a URL and attempts to return the oEmbed data.
- get_html()The do-it-all function that takes a URL and attempts to return the HTML.
- discover()Attempts to discover link tags at the given URL for an oEmbed provider.
- fetch()Connects to an oEmbed provider and returns the result.
- _fetch_with_format()Fetches result from an oEmbed provider for a specific format and complete provider URL
- _parse_json()Parses a json response body.
- _parse_xml()Parses an XML response body.
- _parse_xml_body()Serves as a helper function for parsing an XML response body.
- data2html()Converts a data object from WP_oEmbed::fetch() and returns the HTML.
- _strip_newlines()Strips any new lines from the HTML.
Changelog
Introduced in 2.9.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.1.0
Method
sanitize_provider() added.verified against source2.9.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-oembed.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.