Make WordPress Core


Ignore:
Timestamp:
01/23/2025 11:52:04 PM (6 months ago)
Author:
joedolson
Message:

Editor: Change the Text editor label to Code.

Rename the 'Text' tab of the classic editor to 'Code', mimicking the labels used in the block editor: "Visual editor" and "Code editor".

Update code comment and Help documentation to reference the editor using the new label.

Props lukecavanagh, ctienshi, travel_girl, audrasjb, sabernhardt, joedolson, rseigel, mark-k, sergeybiryukov, presskopp, giuriani, afercia, knutsp, audrasjb, sukhendu2002.
Fixes #38061.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r59188 r59696  
    5555     *     @type string     $tabfocus_elements The previous and next element ID to move the focus to
    5656     *                                         when pressing the Tab key in TinyMCE. Default ':prev,:next'.
    57      *     @type string     $editor_css        Intended for extra styles for both Visual and Text editors.
     57     *     @type string     $editor_css        Intended for extra styles for both Visual and Code editors.
    5858     *                                         Should include `<style>` tags, and can use "scoped". Default empty.
    5959     *     @type string     $editor_class      Extra classes to add to the editor textarea element. Default empty.
     
    185185            if ( self::$this_quicktags ) {
    186186                $default_editor = $set['default_editor'] ? $set['default_editor'] : wp_default_editor();
    187                 // 'html' is used for the "Text" editor tab.
     187                // 'html' is used for the "Code" editor tab.
    188188                if ( 'html' !== $default_editor ) {
    189189                    $default_editor = 'tinymce';
     
    195195                    ' data-wp-editor-id="' . $editor_id_attr . '">' . _x( 'Visual', 'Name for the Visual editor tab' ) . "</button>\n";
    196196                $buttons .= '<button type="button" id="' . $editor_id_attr . '-html"' . $tmce_active . ' class="wp-switch-editor switch-html"' .
    197                     ' data-wp-editor-id="' . $editor_id_attr . '">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</button>\n";
     197                    ' data-wp-editor-id="' . $editor_id_attr . '">' . _x( 'Code', 'Name for the Code editor tab (formerly Text)' ) . "</button>\n";
    198198            } else {
    199199                $default_editor = 'tinymce';
     
    273273        );
    274274
    275         // Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat).
     275        // Prepare the content for the Visual or Code editor, only when TinyMCE is used (back-compat).
    276276        if ( self::$this_tinymce ) {
    277277            add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
     
    628628
    629629                /**
    630                  * Filters the list of teenyMCE buttons (Text tab).
     630                 * Filters the list of teenyMCE buttons (Code tab).
    631631                 *
    632632                 * @since 2.7.0
     
    13971397                'Link options'                         => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog.
    13981398                'Visual'                               => _x( 'Visual', 'Name for the Visual editor tab' ),             // Editor switch tab label.
    1399                 'Text'                                 => _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ), // Editor switch tab label.
     1399                'Code'                                 => _x( 'Code', 'Name for the Code editor tab (formerly Text)' ), // Editor switch tab label.
    14001400                'Add Media'                            => array( __( 'Add Media' ), 'accessM' ), // Tooltip for the 'Add Media' button in the block editor Classic block.
    14011401
Note: See TracChangeset for help on using the changeset viewer.