WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
821 | * Filters whether a comment can be trashed. |
822 | * |
823 | * Return false to disable trash support for the post. |
824 | * |
825 | * @since 4.7.0 |
826 | * |
827 | * @param bool $supports_trash Whether the post type support trashing. |
828 | * @param WP_Post $comment The comment object being considered for trashing support. |
829 | */ |
830 | $supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment ); |
831 |
|
832 | $request->set_param( 'context', 'edit' ); |
833 |
|
834 | if ( $force ) { |
835 | $previous = $this->prepare_item_for_response( $comment, $request ); |
836 | $result = wp_delete_comment( $comment->comment_ID, true ); |
837 | $response = new WP_REST_Response(); |
838 | $response->set_data( |
839 | array( |