rest_{$this->post_type}_trashable

rest_{$this->post_type}_trashable

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

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('rest_{$this->post_type}_trashable') is found 1 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 1089
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    *
     * @param bool    $supports_trash Whether the post type support trashing.
     * @param WP_Post $post           The Post object being considered for trashing support.
     */
    $supports_trash = apply_filters( "rest_{$this->post_type}_trashable", $supports_trash, $post );
     
    if ( ! $this->check_delete_permission( $post ) ) {
        return new WP_Error(
            'rest_user_cannot_delete_post',
            __( 'Sorry, you are not allowed to delete this post.' ),
            array( 'status' => rest_authorization_required_code() )