http_request_version
Filters the version of the HTTP protocol used in a request.
Использование
add_filter( 'http_request_version', 'wp_kama_http_request_version_filter', 10, 2 );
/**
* Function for `http_request_version` filter-hook.
*
* @param string $version Version of HTTP used. Accepts '1.0' and '1.1'.
* @param string $url The request URL.
*
* @return string
*/
function wp_kama_http_request_version_filter( $version, $url ){
// filter...
return $version;
}
- $version(строка)
- Version of HTTP used. Accepts '1.0' and '1.1'.
По умолчанию: '1.0' - $url(строка)
- The request URL.
Список изменений
| С версии 2.7.0 | Введена. |
| С версии 5.1.0 | The $url parameter was added. |
Где вызывается хук
http_request_version
wp-includes/class-wp-http.php 201
'httpversion' => apply_filters( 'http_request_version', '1.0', $url ),