rest_(post_type)_trashable хук-фильтр . WP 4.7.0
Filters whether a post is trashable.
The dynamic portion of the hook name, $this->post_type, refers to the post type slug.
Pass false to disable Trash support for the post.
Использование
add_filter( 'rest_(post_type)_trashable', 'filter_function_name_1527', 10, 2 ); function filter_function_name_1527( $supports_trash, $post ){ // filter... return $supports_trash; }
- $supports_trash(true/false)
- Whether the post type support trashing.
- $post(WP_Post)
- The Post object being considered for trashing support.
Список изменений
С версии 4.7.0 | Введена. |
Где вызывается хук
rest_(post_type)_trashable
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 901
$supports_trash = apply_filters( "rest_{$this->post_type}_trashable", $supports_trash, $post );