Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save crisgaret/624629a0877b49123ff03c40163791d1 to your computer and use it in GitHub Desktop.

Select an option

Save crisgaret/624629a0877b49123ff03c40163791d1 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Ninja Forms - Webhooks Auth Headers
*/
add_filter( 'nf_remote_post_args', 'nf_wh_add_auth' );
function nf_wh_add_auth( $args ){
$headers = array(
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( YOUR_USERNAME . ':' . YOUR_PASSWORD )
)
);
$args = array_merge( $args, $headers );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment