Skip to content

ip-location-block-headers


Looking for current setup instructions?

The Codex is preserved as a legacy and developer reference. The current interface is documented in the new guides.

Open current guide

HTTP headers which this plugin sends when getting the remote content.

Description

The filter hook “ip-location-block-headers” assigns the array of HTTP headers which is passed to wp_remote_get().

Parameters

  • $args
    array( 'timeout' => 5, 'user-agent' => 'WordPress/4.8, ip-location-block 3.1' )

Use case

The following code snippet in your theme’s functions.php can set timeout to 3 seconds.

function my_http_headers( $args ) {
    $args['timeout'] = 3;
    return $args;
}
add_filter( 'ip-location-block-headers', 'my_http_headers' );
NOTE: When you select "mu-plugins" (ip-location-block-mu.php) as Validation timing , you should put your code snippet into drop-in.php in Geolocation API folder instead of functions.php. See My custom functions in “functions.php” doesn’t work. in FAQ for detail.

Since

1.1.1

All Legacy Codex entries