WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
320 | * Filter oEmbed remote get arguments. |
321 | * |
322 | * @since 4.0.0 |
323 | * |
324 | * @see WP_Http::request() |
325 | * |
326 | * @param array $args oEmbed remote get arguments. |
327 | * @param string $url URL to be inspected. |
328 | */ |
329 | $args = apply_filters( 'oembed_remote_get_args', array(), $url ); |
330 |
|
331 | // Fetch URL content |
332 | $request = wp_safe_remote_get( $url, $args ); |
333 | if ( $html = wp_remote_retrieve_body( $request ) ) { |
334 |
|
335 | /** |
336 | * Filter the link types that contain oEmbed provider URLs. |
337 | * |
338 | * @since 2.9.0 |
Line | Code |
425 | * @access private |
426 | * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.) |
427 | * @param string $format Format to use |
428 | * @return false|object|WP_Error False on failure, otherwise the result in the form of an object. |
429 | */ |
430 | private function _fetch_with_format( $provider_url_with_args, $format ) { |
431 | $provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args ); |
432 |
|
433 | /** This filter is documented in wp-includes/class-oembed.php */ |
434 | $args = apply_filters( 'oembed_remote_get_args', array(), $provider_url_with_args ); |
435 |
|
436 | $response = wp_safe_remote_get( $provider_url_with_args, $args ); |
437 | if ( 501 == wp_remote_retrieve_response_code( $response ) ) |
438 | return new WP_Error( 'not-implemented' ); |
439 | if ( ! $body = wp_remote_retrieve_body( $response ) ) |
440 | return false; |
441 | $parse_method = "_parse_$format"; |
442 | return $this->$parse_method( $body ); |
443 | } |