From 3af74dfcbbe9b7b03ae70e6715b3acbaaa97909f Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 26 Oct 2016 01:41:46 +0000 Subject: [PATCH] TinyMCE: remove the numbers (2-6) after the headings in the drop-down. These are previews for the actual styling of headings in the editor. See #27159. git-svn-id: https://develop.svn.wordpress.org/trunk@38939 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 1 + src/wp-includes/js/tinymce/plugins/wordpress/plugin.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index b20126f53e..9c6738907c 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -839,6 +839,7 @@ final class _WP_Editors { 'Formats' => _x( 'Formats', 'TinyMCE' ), 'Headings' => _x( 'Headings', 'TinyMCE' ), + 'Heading' => _x( 'Heading', 'TinyMCE' ), 'Heading 1' => array( __( 'Heading 1' ), 'access1' ), 'Heading 2' => array( __( 'Heading 2' ), 'access2' ), 'Heading 3' => array( __( 'Heading 3' ), 'access3' ), diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index beaddf945f..6565221c28 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -578,6 +578,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { each( listbox.settings.values, function( item ) { if ( item.text && labels.hasOwnProperty( item.text ) ) { item.shortcut = '(' + labels[ item.text ] + ')'; + + // Drop the numbers after the labels for headings. + // TinyMCE makes previews for the h1-h6. It uses the same styles that are applied in the editor body. + if ( item.text.indexOf( 'Heading' ) !== -1 ) { + item.text = 'Heading'; + } } } ); }