Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created August 6, 2015 16:26
Show Gist options
  • Select an option

  • Save kjohnson/7bac9077356d96fc91c5 to your computer and use it in GitHub Desktop.

Select an option

Save kjohnson/7bac9077356d96fc91c5 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;
}
@crisgaret
Copy link

Looks like it isn't valid for NF3. I am also looking for the ability of adding header parameters.
thanks.
/chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment