WordPress.org

Make WordPress Core

Ticket #42119: 42119.diff

File 42119.diff, 1.4 KB (added by danieltj, 3 years ago)

Adds filter for the post editor to swap out to another.

  • wp-admin/edit-form-advanced.php

    diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php
    index 5079681..c9e666b 100644
    if ( post_type_supports($post_type, 'editor') ) { 
    619619?>
    620620<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
    621621
    622 <?php wp_editor( $post->post_content, 'content', array(
     622<?php
     623
     624// Default HTML ID for the post editor
     625$editor_id = 'content';
     626
     627// Default arguments for the post editor
     628$editor_args = array(
    623629        '_content_editor_dfw' => $_content_editor_dfw,
    624630        'drag_drop_upload' => true,
    625631        'tabfocus_elements' => 'content-html,save-post',
    if ( post_type_supports($post_type, 'editor') ) { 
    629635                'wp_autoresize_on' => $_wp_editor_expand,
    630636                'add_unload_trigger' => false,
    631637        ),
    632 ) ); ?>
     638);
     639
     640/**
     641 * Filters the text editor for post content.
     642 *
     643 * @param string $editor_id   HTML ID for the editor.
     644 * @param array  $editor_args Array of arguments for the editor.
     645 *
     646 * @since 4.9
     647 * @return void
     648 */
     649apply_filters('wp_post_content_editor', $editor_id, $editor_args);
     650
     651wp_editor( $post->post_content, $editor_id, $editor_args ); ?>
     652
    633653<table id="post-status-info"><tbody><tr>
    634654        <td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
    635655        <td class="autosave-info">