The dynamic portion of the hook name, $this->post_type, refers to the post type slug. Possible hook names include: <ul> <li>rest_post_trashable</li> <li>rest_page_trashable</li> <li>rest_attachment_trashable</li> </ul> Pass false to disable Trash support for the post.
Parameters
$supports_trashbool
Whether the post type support trashing.
$postWP_Post
The Post object being considered for trashing support.
1114*1115* @since 4.7.01116*1117* @param bool$supports_trash Whether the post type support trashing.1118* @param WP_Post$post The Post object being considered for trashing support.1119*/1120$supports_trash=apply_filters("rest_{$this->post_type}_trashable",$supports_trash,$post);11211122if(!$this->check_delete_permission($post)){1123returnnewWP_Error(1124'rest_user_cannot_delete_post',1125__('Sorry, you are not allowed to delete this post.'),1126array('status'=>rest_authorization_required_code())
History
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.