Filter hook 'use_block_editor_for_post'

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

View Source

use_block_editor_for_post

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 8463

Hook Parameters

Type Name Description
bool $use_block_editor Whether the post can be edited or not.
WP_Post $post The post being checked.

Usage Examples

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

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

Source Code Context

wp-includes/post.php:8463 - How this hook is used in WordPress core
<?php
8458  	 * @since 5.0.0
8459  	 *
8460  	 * @param bool    $use_block_editor Whether the post can be edited or not.
8461  	 * @param WP_Post $post             The post being checked.
8462  	 */
8463  	return apply_filters( 'use_block_editor_for_post', $use_block_editor, $post );
8464  }
8465  
8466  /**
8467   * Returns whether a post type is compatible with the block editor.
8468   *

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 can be edited or not.
	 * @param WP_Post $post             The post 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.