Filters the pre-calculated result of a REST API dispatch request. Allow hijacking the request before dispatching by returning a non-empty. The returned value will be used to serve the request instead.
null, $this, $request
Sortie :
@param mixed $result Response to replace the requested version with. Can be anything @param WP_REST_Server $server Server instance. @param WP_REST_Request $request Request used to generate the response.
// Modifier la valeur avec le filtre 'rest_pre_dispatch'
add_filter('rest_pre_dispatch', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre(null) {
// Modifier la valeur
return null;
}
Chargement des actualités...