Skip to content

Instantly share code, notes, and snippets.

@jamesozzie
Last active March 14, 2023 16:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jamesozzie/771d649fe0eb900aa55177aa78c46761 to your computer and use it in GitHub Desktop.
JWT Site Kit fix
<?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