Filter hook 'replace_editor'

in WP Core File wp-admin/includes/class-wp-screen.php at line 312

View Source

replace_editor

Filter Hook
Description
Fetches a screen object.

Hook Information

File Location wp-admin/includes/class-wp-screen.php View on GitHub
Hook Type Filter
Line Number 312

Hook Parameters

Type Name Description
string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen. Defaults to the current $hook_suffix global.

Usage Examples

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

function my_custom_filter($hook_name) {
    // Your custom filtering logic here
    return $hook_name;
}

Source Code Context

wp-admin/includes/class-wp-screen.php:312 - How this hook is used in WordPress core
<?php
 307  						$post = get_post( $post_id );
 308  						if ( $post ) {
 309  							$post_type = $post->post_type;
 310  
 311  							/** This filter is documented in wp-admin/post.php */
 312  							$replace_editor = apply_filters( 'replace_editor', false, $post );
 313  
 314  							if ( ! $replace_editor ) {
 315  								$is_block_editor = use_block_editor_for_post( $post );
 316  							}
 317  						}

PHP Documentation

<?php
/**
	 * Fetches a screen object.
	 *
	 * @since 3.3.0
	 *
	 * @global string $hook_suffix
	 *
	 * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
	 *                                    Defaults to the current $hook_suffix global.
	 * @return WP_Screen Screen object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/class-wp-screen.php
Related Hooks

Related hooks will be displayed here in future updates.