WP Webhooks / Docs / fswa_http_args
Filter since v1.0.0

fswa_http_args

Filters the full `wp_remote_request()` arguments array before the HTTP call.

$

/ Signature

apply_filters( 'fswa_http_args', $args, $url, $payload )

/ When it fires

Fires immediately before `wp_remote_request()` is called.

/ Parameters

NameInTypeReqDescription
$argsparamarrayyesFull `wp_remote_request()` args including `method`, `headers`, `body`, `timeout`, `sslverify`.
$urlparamstringyesThe resolved endpoint URL.
$payloadparamarrayyesThe outgoing payload array.

/ Returns

array Modified `wp_remote_request()` args.

/ Examples

Disable SSL verification in local development

add_filter( 'fswa_http_args', function ( $args, $url, $payload ) {
    if ( defined( 'WP_LOCAL_DEV' ) && WP_LOCAL_DEV ) {
        $args['sslverify'] = false;
    }
    return $args;
}, 10, 3 );

/ Related

Ready

Stop losing webhooks.
Start logging them.

$ wp plugin install flowsystems-webhook-actions --activate