pre_http_send_through_proxy хук-фильтрWP 3.5.0

Filters whether to preempt sending the request through the proxy.

Returning false will bypass the proxy; returning true will send the request through the proxy. Returning null bypasses the filter.

Использование

add_filter( 'pre_http_send_through_proxy', 'wp_kama_pre_http_send_through_proxy_filter', 10, 4 );

/**
 * Function for `pre_http_send_through_proxy` filter-hook.
 * 
 * @param bool|null $override Whether to send the request through the proxy.
 * @param string    $uri      URL of the request.
 * @param array     $check    Associative array result of parsing the request URL with `parse_url()`.
 * @param array     $home     Associative array result of parsing the site URL with `parse_url()`.
 *
 * @return bool|null
 */
function wp_kama_pre_http_send_through_proxy_filter( $override, $uri, $check, $home ){

	// filter...
	return $override;
}
$override(true|false|null)
Whether to send the request through the proxy.
По умолчанию: null
$uri(строка)
URL of the request.
$check(массив)
Associative array result of parsing the request URL with parse_url().
$home(массив)
Associative array result of parsing the site URL with parse_url().

Список изменений

С версии 3.5.0 Введена.

Где вызывается хук

WP_HTTP_Proxy::send_through_proxy()
pre_http_send_through_proxy
wp-includes/class-wp-http-proxy.php 194
$result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home );

Где используется хук в WordPress

Использование не найдено.