http_request_redirection_count filter-hookWP 2.7.0

Filters the number of redirects allowed during an HTTP request.

Usage

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.
Default: 5
$url(string)
The request URL.

Changelog

Since 2.7.0 Introduced.
Since 5.1.0 The $url parameter was added.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.