From e1ae82757731e2910fd646b1cde79b456219a6b1 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 25 Oct 2016 22:51:36 +0000 Subject: [PATCH] TinyMCE: remove and rearrange some of the editor buttons to improve user experience. Props hugobaeta, melchoyce, celloexpressions, mor10, iseulde, mrwweb. See #27159. Built from https://develop.svn.wordpress.org/trunk@38932 git-svn-id: http://core.svn.wordpress.org/trunk@38875 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-editor.php | 14 ++++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 835a2a5fef..b20126f53e 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -554,6 +554,16 @@ final class _WP_Editors { // Limit the preview styles in the menu/toolbar 'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform', + // Disable H1 in the drop-down and the menu. + 'block_formats' => + 'Paragraph=p;' . + 'Heading 2=h2;' . + 'Heading 3=h3;' . + 'Heading 4=h4;' . + 'Heading 5=h5;' . + 'Heading 6=h6;' . + 'Preformatted=pre', + 'end_container_on_empty_block' => true, 'wpeditimage_disable_captions' => $no_captions, 'wpeditimage_html5_captions' => current_theme_supports( 'html5', 'caption' ), @@ -609,7 +619,7 @@ final class _WP_Editors { $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ); $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array(); } else { - $mce_buttons = array( 'bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' ); + $mce_buttons = array( 'formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' ); if ( ! wp_is_mobile() ) { if ( $set['_content_editor_dfw'] ) { @@ -631,7 +641,7 @@ final class _WP_Editors { */ $mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id ); - $mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' ); + $mce_buttons_2 = array( 'strikethrough', 'hr', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' ); if ( ! wp_is_mobile() ) { $mce_buttons_2[] = 'wp_help'; diff --git a/wp-includes/version.php b/wp-includes/version.php index b48d4943dd..4feabe77e0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38931'; +$wp_version = '4.7-alpha-38932'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.