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.2

apply_filters('replace_editor') is found 3 times:

  • /wp-admin/includes/class-wp-screen.php line 312
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
        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
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    $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
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    *
     * @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: