Last active
May 5, 2025 17:45
-
-
Save aguilar1181/357a127f1dacf8bc7f070e5290ead03d to your computer and use it in GitHub Desktop.
Add custom headers to the webhook post request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Add custom headers to Ninja Forms webhook post request | |
* Webhook addon required. Works with NF version 3+ | |
*/ | |
add_filter( 'nf_remote_post_headers', 'nf_wh_custom_headers' ); | |
function nf_wh_custom_headers( $headers ) { | |
// Assuming you have a way to securely store and retrieve the token | |
$token = 'your_bearer_token_here'; // Replace this with your actual token or a function to retrieve it securely | |
$headers = array( | |
'headers' => array( | |
'Authorization' => 'Bearer ' . $token ) | |
) | |
); | |
return $headers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment