rest_attachment_item_schema
Filters the post's schema.
Это один из вариантов динамического хука rest_(post_type)_item_schema
Использование
add_filter( 'rest_attachment_item_schema', 'wp_kama_rest_attachment_item_schema_filter' ); /** * Function for `rest_attachment_item_schema` filter-hook. * * @param array $schema Item schema data. * * @return array */ function wp_kama_rest_attachment_item_schema_filter( $schema ){ // filter... return $schema; }
- $schema(массив)
- Item schema data.
Список изменений
С версии 5.4.0 | Введена. |
Где вызывается хук
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2617
$schema = apply_filters( "rest_{$this->post_type}_item_schema", $schema );