rest_prepare_{$this->post_type}

FILTER wp-includes\rest-api\endpoints\class-wp-rest-posts-controller.php (ligne 1861) github
This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

Paramètres

Entrée :
new WP_REST_Response( array(
Sortie :
N/A

Utilisation

// Modifier la valeur avec le filtre 'rest_prepare_{$this->post_type}'
add_filter('rest_prepare_{$this->post_type}', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(new WP_REST_Response( array() {
    // Modifier la valeur
    return new WP_REST_Response( array(;
}

Actualités

Chargement des actualités...