Skip to content
Docs
Get RestroPress

Filter

rpress_webhooks_request_timeout

Updated
On this page

Filters how many seconds a webhook request waits for the receiver.

Used for every webhook POST, both queued deliveries and the send test button. Values below 1 are raised to 1. A queue worker run stops starting new deliveries after about 40 seconds, so long timeouts mean fewer deliveries per run.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$timeoutintSeconds. Default 10.
$urlstringTarget URL.

Return value#

int. Timeout in seconds.

Example#

add_filter( 'rpress_webhooks_request_timeout', 'my_webhook_timeout', 10, 2 );
function my_webhook_timeout( $timeout, $url ) {
	if ( 'hooks.example.com' === wp_parse_url( $url, PHP_URL_HOST ) ) {
		return 20;
	}
	return $timeout;
}

Source#

Applied in:

  • includes/features/webhooks/delivery.php (line 178), in rpress_webhooks_send()

See also#

Was this page helpful?