rest_url_details_http_request_args filter-hookWP 5.9.0

Filters the HTTP request args for URL data retrieval.

Can be used to adjust response size limit and other WP_Http::request() args.

Usage

add_filter( 'rest_url_details_http_request_args', 'wp_kama_rest_url_details_http_request_args_filter', 10, 2 );

/**
 * Function for `rest_url_details_http_request_args` filter-hook.
 * 
 * @param array  $args Arguments used for the HTTP request.
 * @param string $url  The attempted URL.
 *
 * @return array
 */
function wp_kama_rest_url_details_http_request_args_filter( $args, $url ){

	// filter...
	return $args;
}
$args(array)
Arguments used for the HTTP request.
$url(string)
The attempted URL.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

WP_REST_URL_Details_Controller::get_remote_url()
rest_url_details_http_request_args
wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php 252
$args = apply_filters( 'rest_url_details_http_request_args', $args, $url );

Where the hook is used in WordPress

Usage not found.