Filters the list of request headers that are allowed for REST API CORS requests. The allowed headers are passed to the browser to specify which headers can be passed to the REST API. By default, we allow the Content-* headers needed to upload files to the media endpoints. As well as the Authorization and Nonce headers for allowing authentication.
$allow_headers, $request
Sortie :
@param string[] $allow_headers The list of request headers to allow. @param WP_REST_Request $request The request in context.
// Modifier la valeur avec le filtre 'rest_allowed_cors_headers'
add_filter('rest_allowed_cors_headers', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($allow_headers) {
// Modifier la valeur
return $allow_headers;
}
Chargement des actualités...