rest_{$this->post_type}_item_schema

FILTER wp-includes\rest-api\endpoints\class-wp-rest-posts-controller.php (ligne 2759) github
Filters the post's schema. The dynamic portion of the filter, `$this->post_type`, refers to the post type slug for the controller. Possible hook names include:  - `rest_post_item_schema`  - `rest_page_item_schema`  - `rest_attachment_item_schema`

Paramètres

Entrée :
$schema
Sortie :
@param array $schema Item schema data.

Utilisation

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

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

Actualités

Chargement des actualités...