Filter hook 'use_block_editor_for_post_type'

in WP Core File wp-includes/post.php at line 8500

View Source

use_block_editor_for_post_type

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

Hook Information

File Location wp-includes/post.php View on GitHub
Hook Type Filter
Line Number 8500

Hook Parameters

Type Name Description
bool $use_block_editor Whether the post type can be edited or not. Default true.
string $post_type The post type being checked.

Usage Examples

Basic Usage
<?php
// Hook into use_block_editor_for_post_type
add_filter('use_block_editor_for_post_type', 'my_custom_filter', 10, 2);

function my_custom_filter($use_block_editor, $post_type) {
    // Your custom filtering logic here
    return $use_block_editor;
}

Source Code Context

wp-includes/post.php:8500 - How this hook is used in WordPress core
<?php
8495  	 * @since 5.0.0
8496  	 *
8497  	 * @param bool   $use_block_editor  Whether the post type can be edited or not. Default true.
8498  	 * @param string $post_type         The post type being checked.
8499  	 */
8500  	return apply_filters( 'use_block_editor_for_post_type', true, $post_type );
8501  }
8502  
8503  /**
8504   * Registers any additional post meta fields.
8505   *

PHP Documentation

<?php
/**
	 * 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 type can be edited or not. Default true.
	 * @param string $post_type         The post type being checked.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.