rest_comment_trashable

rest_comment_trashable

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.8

apply_filters('rest_comment_trashable') is found 1 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php line 980
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    *
     * @param bool       $supports_trash Whether the comment supports trashing.
     * @param WP_Comment $comment        The comment object being considered for trashing support.
     */
    $supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );
     
    $request->set_param( 'context', 'edit' );
     
    if ( $force ) {
        $previous = $this->prepare_item_for_response( $comment, $request );
        $result   = wp_delete_comment( $comment->comment_ID, true );