Created
April 26, 2022 10:55
-
-
Save New0/7aa904c822604588f3c9066c54de8af9 to your computer and use it in GitHub Desktop.
Whitelist Ninja Forms routes for JWT auth plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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