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.
1109*1110* @since 4.7.01111*1112* @param bool$supports_trash Whether the post type support trashing.1113* @param WP_Post$post The Post object being considered for trashing support.1114*/1115$supports_trash=apply_filters("rest_{$this->post_type}_trashable",$supports_trash,$post);11161117if(!$this->check_delete_permission($post)){1118returnnewWP_Error(1119'rest_user_cannot_delete_post',1120__('Sorry, you are not allowed to delete this post.'),1121array('status'=>rest_authorization_required_code())
History
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.