Filter
rp_api_not_enabled_error_message
On this page
Filters the error message returned when the token endpoint is not enabled.
Used in the REST auth controller permission check when the Enable Token Endpoint setting is off. The message is returned in a WP_Error with the rest_forbidden code.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$message | string | Default message, 'API has not enabled!!!.'. |
$request | WP_REST_Request | The current REST request. |
Return value#
string. The error message.
Example#
function my_api_not_enabled_message( $message, $request ) {
return __( 'The API is currently disabled.', 'my-textdomain' );
}
add_filter( 'rp_api_not_enabled_error_message', 'my_api_not_enabled_message', 10, 2 );
Source#
Applied in:
includes/rest-api/Controllers/Version1/class-rp-rest-auth-v1-controller.php(line 229), inRP_REST_Auth_V1_Controller::get_auth_permissions_check()
See also#
Was this page helpful?
