JWT Site Kit fix
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: JWT Auth Site Kit Fix | |
* Plugin URI: http://www.jamesozz.ie | |
* Description: Whitelist Google Site Kit API calls in JWT Auth by Useful Team. | |
* Version: 1.0 | |
* Author: James Osborne | |
* Author URI: http://www.jamesozz.ie | |
*/ | |
add_filter( 'jwt_auth_whitelist', function ( $endpoints ) { | |
$your_endpoints = array( | |
'/wp-json/google-site-kit/*', | |
); | |
return array_unique( array_merge( $endpoints, $your_endpoints ) ); | |
} ); | |
add_filter( 'jwt_auth_default_whitelist', function ( $default_whitelist ) { | |
// Modify the $default_whitelist here. | |
return $default_whitelist; | |
} ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment