rest_pre_echo_response

FILTER wp-includes\rest-api\class-wp-rest-server.php (ligne 538) github
Filters the REST API response. Allows modification of the response data after inserting embedded data (if any) and before echoing the response data.

Paramètres

Entrée :
$result, $this, $request
Sortie :
@param array            $result  Response data to send to the client.
@param WP_REST_Server   $server  Server instance.
@param WP_REST_Request  $request Request used to generate the response.

Utilisation

// Modifier la valeur avec le filtre 'rest_pre_echo_response'
add_filter('rest_pre_echo_response', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($result) {
    // Modifier la valeur
    return $result;
}

Actualités

Chargement des actualités...