WordPress at Your Fingertips
function is not described

use_block_editor_for_post() WP 5.0.0

Return whether the post can be edited in the block editor.

Hooks from the function

Return

true|false. Whether the post can be edited in the block editor.

Usage

use_block_editor_for_post( $post );
$post(int|WP_Post) (required)
Post ID or WP_Post object.

Changelog

Since 5.0.0 Introduced.

Code of use_block_editor_for_post() WP 5.8.2

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;
	}

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

	/**
	 * Filters 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 );
}