Skip to content

Instantly share code, notes, and snippets.

@New0
Created April 26, 2022 10:55
Show Gist options
  • Save New0/7aa904c822604588f3c9066c54de8af9 to your computer and use it in GitHub Desktop.
Save New0/7aa904c822604588f3c9066c54de8af9 to your computer and use it in GitHub Desktop.
Whitelist Ninja Forms routes for JWT auth plugin
<?php
/*
Plugin Name: Whitelist Ninja Forms routes
Plugin URI: https://gist.github.com/New0/7aa904c822604588f3c9066c54de8af9
Description: Whitelist Ninja Forms routes for JWT auth plugin - https://wordpress.org/plugins/jwt-auth/ -
Version: 1.0.0
Author: New0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
$nf_endpoints = array(
'/wp-json/ninja-forms-submissions/*',
);
return array_unique( array_merge( $endpoints, $nf_endpoints ) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment