Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created August 6, 2015 16:26
Show Gist options
  • Save kjohnson/7bac9077356d96fc91c5 to your computer and use it in GitHub Desktop.
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;
}
@IceRich
Copy link

IceRich commented Aug 28, 2017

Hello KJohnson,
i'd like to extend my nf wh addon with the ability of adding one or more header paratmeters. Is that code above still valid for nf 3?
also i have some other suggestions of extending the wh addon.
Erich

@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