Filter hook 'http_request_args'

in WP Core File wp-includes/class-wp-http.php at line 252

View Source

http_request_args

Filter Hook
Description
Filters the arguments used in an HTTP request.

Hook Information

File Location wp-includes/class-wp-http.php View on GitHub
Hook Type Filter
Line Number 252

Hook Parameters

Type Name Description
array $parsed_args An array of HTTP request arguments.
string $url The request URL.

Usage Examples

Basic Usage
<?php
// Hook into http_request_args
add_filter('http_request_args', 'my_custom_filter', 10, 2);

function my_custom_filter($parsed_args, $url) {
    // Your custom filtering logic here
    return $parsed_args;
}

Source Code Context

wp-includes/class-wp-http.php:252 - How this hook is used in WordPress core
<?php
 247  		 * @since 2.7.0
 248  		 *
 249  		 * @param array  $parsed_args An array of HTTP request arguments.
 250  		 * @param string $url         The request URL.
 251  		 */
 252  		$parsed_args = apply_filters( 'http_request_args', $parsed_args, $url );
 253  
 254  		// The transports decrement this, store a copy of the original value for loop purposes.
 255  		if ( ! isset( $parsed_args['_redirection'] ) ) {
 256  			$parsed_args['_redirection'] = $parsed_args['redirection'];
 257  		}

PHP Documentation

<?php
/**
		 * Filters the arguments used in an HTTP request.
		 *
		 * @since 2.7.0
		 *
		 * @param array  $parsed_args An array of HTTP request arguments.
		 * @param string $url         The request URL.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-http.php
Related Hooks

Related hooks will be displayed here in future updates.