use_block_editor_for_post_type filter-hookWP 5.0.0

Filters whether a post is able to be edited in the block editor.

Usage

add_filter( 'use_block_editor_for_post_type', 'wp_kama_use_block_editor_for_post_type_filter', 10, 2 );

/**
 * Function for `use_block_editor_for_post_type` filter-hook.
 * 
 * @param bool   $use_block_editor Whether the post type can be edited or not.
 * @param string $post_type        The post type being checked.
 *
 * @return bool
 */
function wp_kama_use_block_editor_for_post_type_filter( $use_block_editor, $post_type ){

	// filter...
	return $use_block_editor;
}
$use_block_editor(true|false)
Whether the post type can be edited or not.
Default: true
$post_type(string)
The post type being checked.

Changelog

Since 5.0.0 Introduced.

Where the hook is called

use_block_editor_for_post_type()
use_block_editor_for_post_type
wp-includes/post.php 8124
return apply_filters( 'use_block_editor_for_post_type', true, $post_type );

Where the hook is used in WordPress

wp-admin/includes/admin-filters.php 89
add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );