WordPress at a glance
filter is not described

rest_(post_type)_trashable filter-hook . 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_5281', 10, 2 );
function filter_function_name_5281( $supports_trash, $post ){
	// filter...

	return $supports_trash;
Whether the post type support trashing.
The Post object being considered for trashing support.

Список изменений

С версии 4.7.0 Введена.

Где вызывается хук

wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 896
$supports_trash = apply_filters( "rest_{$this->post_type}_trashable", $supports_trash, $post );

Где используется хук в ядре WordPress

Использование не найдено.