Skip to content
Docs
Get RestroPress

Filter

rp_api_token_is_null_error_message

Updated
On this page

Filters the error message returned when the API token is missing or empty.

Used in the JWT verifier when no token was found in the request. The message is returned in a rest_forbidden WP_Error.

Parameters#

ParameterTypeDescription
$messagestringDefault message, 'Token is null!!!'.

Return value#

string. The error message.

Example#

function my_token_null_message( $message ) {
	return __( 'An access token is required.', 'my-textdomain' );
}
add_filter( 'rp_api_token_is_null_error_message', 'my_token_null_message' );

Source#

Applied in:

  • includes/rest-api/Utilities/RP_JWT_Verifier.php (line 46), in RP_JWT_Verifier::incoming_token_verify()

See also#

Was this page helpful?