WordPress at Your Fingertips
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.

Possible hook names include:

  • rest_post_trashable
  • rest_page_trashable
  • rest_attachment_trashable

Pass false to disable Trash support for the post.


add_filter( 'rest_(post_type)_trashable', 'filter_function_name_7408', 10, 2 );
function filter_function_name_7408( $supports_trash, $post ){
	// filter...

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


Since 4.7.0 Introduced.

Where the hook is called

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

Where in WP core the hook is used WordPress

Usage not found.