Available since: 1.0
searchwp_timeout
View Parameters »SearchWP’s indexer runs in the background by making a series of daisy-chained HTTP requests to the site_url() of the WordPress install. Since the HTTP request being made is a non-blocking local request it has been configured with a timeout of 0.02s. In the rare case that you want to increase this timeout, you can use this hook by adding the following to your theme’s functions.php:
<?php | |
function my_searchwp_timeout( $timeout ) { | |
// 1s timeout | |
return 1; | |
} | |
add_filter( 'searchwp_timeout', 'my_searchwp_timeout' ); |
This will cause the HTTP request to pause for 1 second before proceeding. Please note that even though the request is non-blocking, the timeout will still execute in full, so use this filter carefully.
Parameters
Parameter | Type | Description |
---|---|---|
$timeout |
Integer|Float |
How long of a timeout to use when making loopback requests |