http_request_redirection_count хук-фильтрWP 2.7.0

Filters the number of redirects allowed during an HTTP request.

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

add_filter( 'http_request_redirection_count', 'wp_kama_http_request_redirection_count_filter', 10, 2 );

/**
 * Function for `http_request_redirection_count` filter-hook.
 * 
 * @param int    $redirect_count Number of redirects allowed.
 * @param string $url            The request URL.
 *
 * @return int
 */
function wp_kama_http_request_redirection_count_filter( $redirect_count, $url ){

	// filter...
	return $redirect_count;
}
$redirect_count(int)
Number of redirects allowed.
По умолчанию: 5
$url(строка)
The request URL.

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

С версии 2.7.0 Введена.
С версии 5.1.0 The $url parameter was added.

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

WP_Http::request()
http_request_redirection_count
wp-includes/class-wp-http.php 172
'redirection'         => apply_filters( 'http_request_redirection_count', 5, $url ),

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

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