Paramètres

$use_block_editor

(bool) Pour que le poste soit édité ou non.

$post

(WP_Post) Le poste à vérifier.

Où trouver le hook use_block_editor_for_post dans le CMS Wordpress

wp-admin/includes/post.php

Ligne 2084

 * @return bool Whether the post can be edited in the block editor.
 */
function use_block_editor_for_post( $post ) {
    $post = get_post( $post );

    if ( ! $post ) {
        return false;
    }

    // We're in the meta box loader, so don't use the block editor.
    if ( isset( $_GET['meta-box-loader'] ) ) {
        check_admin_referer( 'meta-box-loader', 'meta-box-loader-nonce' );
        return false;
    }

    // The posts page can't be edited in the block editor.
    if ( absint( get_option( 'page_for_posts' ) ) === $post->ID && empty( $post->post_content ) ) {
        return false;
    }

    $use_block_editor = use_block_editor_for_post_type( $post->post_type );

    /**
     * Filter whether a post is able to be edited in the block editor.
     *
     * @since 5.0.0
     *
     * @param bool    $use_block_editor Whether the post can be edited or not.
     * @param WP_Post $post             The post being checked.
     */
    return apply_filters( 'use_block_editor_for_post', $use_block_editor, $post );
}

Exemples

Pour désactiver l'éditeur de bloque pour tous les types de postes, utiliser le filtre suivant :
add_filter('use_block_editor_for_post', '__return_false');
function prefix_enable_block_editor_for_post( $use_block_editor, $post ) {
    // Enable Block Editor for post with ID 123.
    if ( 123 === $post->ID ) {
        return true;
    }
    return $use_block_editor;
}
add_filter( 'use_block_editor_for_post', 'prefix_enable_block_editor_for_post', 10, 2 );

Sources

Source Wordpress : use_block_editor_for_post

Autres hooks dans le même fichier : wp-admin/includes/post.php