This works for me!
If you’re adding the filter inside theme and the it doesn’t work, please create a small 1 file plugin and add your filter there.
It should fix the issue.
add_filter( 'jwt_auth_default_whitelist', function ( $default_whitelist ) {
// Modify the $default_whitelist here.
return $default_whitelist;
} );
—–
<?php
/**
* Plugin Name: -
* Description: -
* Version: -
* Author: -
* Author -
* License: -
*
* Text Domain: whitelist for Contact Form 7
*
* @package .
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/*----------------------------------------------------------------------------*/
/**
* JWT whitelist for Contact Form 7
*/
add_filter(
'jwt_auth_default_whitelist',
function ($whitelist) {
$whitelist[] = '/wp-json/contact-form-7/';
return $whitelist;
},
10,
2
);