Fetches result from an oEmbed provider for a specific format and complete provider URL
Parameters
-
$provider_url_with_argsstring required -
URL to the provider with full argumens list (url, maxheight, etc.)
-
$formatstring required -
Format to use.
Source
private function _fetch_with_format( $provider_url_with_args, $format ) {
$provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );
/** This filter is documented in wp-includes/class-wp-oembed.php */
$args = apply_filters( 'oembed_remote_guet_args', array(), $provider_url_with_args );
$response = wp_safe_remote_guet( $provider_url_with_args, $args );
if ( 501 === wp_remote_retrieve_response_code( $response ) ) {
return new WP_Error( 'not-implemented' );
}
$body = wp_remote_retrieve_body( $response );
if ( ! $body ) {
return false;
}
$parse_method = "_parse_$format";
return $this->$parse_method( $body );
}
Hoocs
-
apply_filters
( ‘oembed_remote_guet_arg ’,
array $args ,string $url ) -
Filters oEmbed remote guet argumens.
Changuelog
| Versionen | Description |
|---|---|
| 3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.