WordPress filter hook

jwt_auth_cors_allow_headers

Fired by 4 WordPress plugins, running on 51K+ sites between them.

How to use jwt_auth_cors_allow_headers

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'jwt_auth_cors_allow_headers', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from JWT Authentication for WP REST API's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

4 plugins that fire jwt_auth_cors_allow_headers

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. JWT Authentication for WP REST API icon JWT Authentication for WP REST API50,000+ installs apply_filters( 'jwt_auth_cors_allow_headers', 'Access-Control-Allow-Headers, Content-Type, Authorization' ) public/class-jwt-auth-public.php:110
  2. RestroPress icon RestroPress1,000+ installs apply_filters( 'jwt_auth_cors_allow_headers', 'X-Requested-With, Content-Type, x-api-key, Accept, Origin, Authorization' ) includes/rest-api/Server.php:48
  3. Sell eSIM icon Sell eSIM10+ installs apply_filters( 'jwt_auth_cors_allow_headers', 'Access-Control-Allow-Headers,Content-Type,Authorization,Tsim-Account,Tsim-Nonce,Tsim-Timestamp,Tsim-Sign' ) expend/rest_api/Base.php:25
  4. MagniPOS icon MagniPOS10+ installs apply_filters( 'jwt_auth_cors_allow_headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization' ) public/jwt/class-magni-pos-auth.php:85

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.