replace_editor

replace_editor

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('replace_editor') is found 3 times:

  • /wp-admin/includes/class-wp-screen.php line 312
    						if ( $post ) {
    							$post_type = $post->post_type;
    
    							/** This filter is documented in wp-admin/post.php */
    							$replace_editor = apply_filters( 'replace_editor', false, $post );
    
    							if ( ! $replace_editor ) {
    								$is_block_editor = use_block_editor_for_post( $post );
    							}
    						}
    					}
    
  • /wp-admin/post-new.php line 70
    $post    = get_default_post_to_edit( $post_type, true );
    $post_ID = $post->ID;
    
    /** This filter is documented in wp-admin/post.php */
    if ( apply_filters( 'replace_editor', false, $post ) !== true ) {
    	if ( use_block_editor_for_post( $post ) ) {
    		require ABSPATH . 'wp-admin/edit-form-blocks.php';
    	} else {
    		wp_enqueue_script( 'autosave' );
    		require ABSPATH . 'wp-admin/edit-form-advanced.php';
    	}
    
  • /wp-admin/post.php line 182
    		 *
    		 * @param bool    $replace Whether to replace the editor. Default false.
    		 * @param WP_Post $post    Post object.
    		 */
    		if ( true === apply_filters( 'replace_editor', false, $post ) ) {
    			break;
    		}
    
    		if ( use_block_editor_for_post( $post ) ) {
    			require ABSPATH . 'wp-admin/edit-form-blocks.php';
    			break;
    

See this hook used in plugins: