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 |
---|---|
433 | * Filters oEmbed remote get arguments. |
434 | * |
435 | * @since 4.0.0 |
436 | * |
437 | * @see WP_Http::request() |
438 | * |
439 | * @param array $args oEmbed remote get arguments. |
440 | * @param string $url URL to be inspected. |
441 | */ |
442 | $args = apply_filters( 'oembed_remote_get_args', $args, $url ); |
443 |
|
444 | // Fetch URL content. |
445 | $request = wp_safe_remote_get( $url, $args ); |
446 | $html = wp_remote_retrieve_body( $request ); |
447 | if ( $html ) { |
448 |
|
449 | /** |
450 | * Filters the link types that contain oEmbed provider URLs. |
451 | * |
Line | Code |
552 | * |
553 | * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.) |
554 | * @param string $format Format to use. |
555 | * @return object|false|WP_Error The result in the form of an object on success, false on failure. |
556 | */ |
557 | private function _fetch_with_format( $provider_url_with_args, $format ) { |
558 | $provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args ); |
559 |
|
560 | /** This filter is documented in wp-includes/class-wp-oembed.php */ |
561 | $args = apply_filters( 'oembed_remote_get_args', array(), $provider_url_with_args ); |
562 |
|
563 | $response = wp_safe_remote_get( $provider_url_with_args, $args ); |
564 | if ( 501 == wp_remote_retrieve_response_code( $response ) ) { |
565 | return new WP_Error( 'not-implemented' ); |
566 | } |
567 | $body = wp_remote_retrieve_body( $response ); |
568 | if ( ! $body ) { |
569 | return false; |
570 | } |