This would be to allow gravity forms to save as new posts which the htaccess is switched on.
// Temporary due to htaccess protection
add_filter( 'http_request_args', 'http_request_args_basic_auth', 10, 2 );
function http_request_args_basic_auth( $args, $url ) {
if ( strpos( $url, admin_url( 'admin-ajax.php' ) ) === 0 ) {
//$args['headers']['Authorization'] = 'Basic ' . base64_encode( USERNAME . ':' . PASSWORD );
$args['headers']['Authorization'] = 'Basic ' . base64_encode( 'sws:sws' );
}
return $args;
}