rest_(post_type)_item_schema хук-фильтр . WP 5.4.0
Filters the post's schema.
The dynamic portion of the filter, $this->post_type, refers to the post type slug for the controller.
Использование
add_filter( 'rest_(post_type)_item_schema', 'filter_function_name_1785' ); function filter_function_name_1785( $schema ){ // filter... return $schema; }
- $schema(массив)
- Item schema data.
Список изменений
С версии 5.4.0 | Введена. |
Где вызывается хук
rest_(post_type)_item_schema
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2465
$schema = apply_filters( "rest_{$this->post_type}_item_schema", $schema );