rest_comment_trashable filter-hook . WP 4.7.0
Filters whether a comment can be trashed.
Return false to disable Trash support for the post.
Usage
add_filter( 'rest_comment_trashable', 'filter_function_name_4293', 10, 2 ); function filter_function_name_4293( $supports_trash, $comment ){ // filter... return $supports_trash; }
- $supports_trash(true/false)
- Whether the post type support trashing.
- $comment(WP_Post)
- The comment object being considered for trashing support.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
rest_comment_trashable
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 967
$supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );