Skip to content

Commit

Permalink
Merge pull request #73 from mrwweb/features/wp64-compat
Browse files Browse the repository at this point in the history
Features/wp64 compat
  • Loading branch information
mrwweb authored Nov 3, 2023
2 parents 85fe0f2 + 5490bfb commit dbad105
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 37 deletions.
22 changes: 22 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
= 2.12.0 (November 3, 2023) =
- WordPress 6.4 compatibility
- Fix error that hid custom theme duotone options
- Fully hide Footnotes inserter unless the block is unhidden via `mrw_hidden_blocks` filter
- Hide "Highlight", "Inline Image", "Inline Code", and "Keyboard" toolbar inline formats. Can be re-enabled via `mrw_hidden_block_editor_settings` filter.
- Hide "Upload" option in "Replace" media menu
- Remove background color options from Cover block placeholder
- Hide new Background Image option on Group block
- Hide new "Text Orientation" / writing mode option

= 2.11.0 (August 21, 2023) =
- **Requires WordPress 6.0**. Legacy code removed
- [New] Show all Post- and Query-related blocks in the Site Editor
- [New] Hide Classic (aka freeform), Details, Footnotes, Comments, and Post Author blocks
- [New] Hide Group / Cover width settings and Group child blocks Justification settings and min-height setting (does not impact Cover min-height setting). Can be shown with `mrw_hidden_block_editor_settings` filter.
- [Dev] The `mrw_hidden_blocks` and all `mrw_hidden_*_blocks` filters now support a second `$context` parameter that contains the current screen's ID so you can target the block editor (`post`), site editor (`site-editor`), or widget editor (`widgets`).
- [New] New Jetpack blocks hidden including AI Assistance, all form blocks, and payment-related blocks
- [Fix] WordPress 6.3 compatibility (re-hide media upload buttons, default gradients, comments block)
- [Fix] "getBlockVariations(…) is undefined warning in Widget and Site Editors
- [Meta] Removed "Formerly MRW Web Design Simple TinyMCE" now that the block editor is 4.5 years old!
- 2.11.1: Change `layout-width-height` value in the `mrw_hidden_block_editor_settings` filter to be accurate `layout-width`.

= 2.10.0 (October 15, 2022) =
- Tested up to WordPress 6.1
- Hide new Text Decoration settings by default (enable via `text-decoration` in `mrw_hidden_block_editor_settings`)
Expand Down
15 changes: 12 additions & 3 deletions css/block-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@
display: none;
}


/*===================================================
= Media Library Button styles =
= Always use Media Library in Flows =
===================================================*/
/*
Hide color options in cover placeholder
Current not configurable due to iFramed block editor
*/
.wp-block-cover__placeholder-background-options {
display: none;
}


/* always style the Media Library item as a primary button */
.block-editor-media-placeholder .components-button.is-tertiary {
background: var(--wp-admin-theme-color);
Expand All @@ -92,7 +100,8 @@

/* Never show "upload" and "from URL" options in WordPress 6.3+ when editor is in iframe */
.block-editor-media-placeholder__upload-button,
.block-editor-media-placeholder__url-input-container {
.block-editor-media-placeholder__url-input-container,
.block-editor-media-replace-flow__media-upload-menu .components-form-file-upload {
display: none;
}

Expand Down
18 changes: 17 additions & 1 deletion inc/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,15 @@ function mrw_hidden_block_editor_settings() {
'heading-1',
'heading-5',
'heading-6',
'highlight',
'image-background',
'image-dimensions',
'image-file-upload',
'image-url',
'inline-code',
'inline-image',
'justification-group',
'keyboard',
'layout-width',
'letter-spacing',
'line-height',
Expand All @@ -393,6 +398,7 @@ function mrw_hidden_block_editor_settings() {
'spacing',
'sticky-position',
'text-decoration',
'text-orientation',
'text-transform',
);

Expand Down Expand Up @@ -444,7 +450,7 @@ function mrw_block_editor_settings( $editor_settings, $context ) {

/* Duotone */
if( in_array( 'duotone', $hidden_settings ) ) {
$editor_settings['__experimentalFeatures']['color']['duotone'] = null;
$editor_settings['__experimentalFeatures']['color']['defaultDuotone'] = false;
$editor_settings['__experimentalFeatures']['color']['customDuotone'] = false;
}

Expand All @@ -463,6 +469,11 @@ function mrw_block_editor_settings( $editor_settings, $context ) {
$editor_settings['__experimentalFeatures']['spacing'] = [];
}

/* Image Background (just Group for not, not including Cover) */
if( in_array( 'image-background', $hidden_settings ) ) {
$editor_settings['__experimentalFeatures']['background']['backgroundImage'] = false;
}

/* Letter Spacing */
if( in_array( 'letter-spacing', $hidden_settings ) ) {
$editor_settings['__experimentalFeatures']['typography']['letterSpacing'] = false;
Expand All @@ -488,6 +499,11 @@ function mrw_block_editor_settings( $editor_settings, $context ) {
$editor_settings['__experimentalFeatures']['typography']['textDecoration'] = false;
}

/* Text Orientation */
if( in_array( 'text-orientation', $hidden_settings ) ) {
$editor_settings['__experimentalFeatures']['typography']['writingMode'] = false;
}

/* Text Transform */
if( in_array( 'text-transform', $hidden_settings ) ) {
$editor_settings['__experimentalFeatures']['typography']['textTransform'] = false;
Expand Down
17 changes: 17 additions & 0 deletions js/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,21 @@ wp.domReady( function() {

});

/* Remove Inline Footnote inserted in block toolbar if Footnote block is hidden */
if( mrwEditorOptions.hiddenBlocks.indexOf( 'core/footnotes' ) ) {
wp.richText.unregisterFormatType( 'core/footnote' );
}
if( mrwEditorOptions.hiddenSettings.indexOf('highlight' ) ) {
wp.richText.unregisterFormatType( 'core/text-color');
}
if( mrwEditorOptions.hiddenSettings.indexOf('inline-image' ) ) {
wp.richText.unregisterFormatType( 'core/image' );
}
if( mrwEditorOptions.hiddenSettings.indexOf('inline-code' ) ) {
wp.richText.unregisterFormatType( 'core/code' );
}
if( mrwEditorOptions.hiddenSettings.indexOf('keyboard' ) ) {
wp.richText.unregisterFormatType( 'core/keyboard' );
}

});
2 changes: 1 addition & 1 deletion mrwweb-simple-tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: MRW Simplified Editor
* Plugin URI: https://MRWweb.com/wordpress-plugins/mrw-web-design-simple-tinymce/
* Description: Streamlines the WordPress editor to focus users on consistent formatting and semantic content.
* Version: 2.11.1
* Version: 2.12.0
* Author: Mark Root-Wiley
* Author URI: https://MRWweb.com
* Text Domain: mrw-web-design-simple-tinymce
Expand Down
49 changes: 17 additions & 32 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: mrwweb
Tags: Block Editor, Blocks, Gutenberg, Editor Styles, Editor
Requires at least: 6.0
Requires PHP: 5.6.20
Tested up to: 6.3
Stable tag: 2.11.1
Tested up to: 6.4
Stable tag: 2.12.0
Donate link: https://www.paypal.me/rootwiley
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -25,8 +25,8 @@ This plugin greatly simplifies the block editor by **hiding** all of the followi

- **Infrequently Used Core Blocks** such as Verse, Table, Audio, Video, etc., and all Query- and Site-related blocks. See FAQ for [full list of hidden blocks](https://wordpress.org/plugins/mrw-web-design-simple-tinymce/#faq).
- **All Core Block Styles and the "Default style" feature**
- **Some Block Editor Settings:** Drop Cap, Heading 1, Heading 5, Heading 6, image percentage and pixel sizing, font sizing by pixel, open links in new tabs (mostly hidden), duotone, text styles like line-height and letter spacing, etc.
- **Default Color & gradient settings** (Custom theme palettes/settings are never hidden)
- **Some Block Editor Settings:** Drop Cap, Heading 1, Heading 5, Heading 6, font sizing by pixel, open links in new tabs (mostly hidden), duotone, text styles like line-height and letter spacing, inline formats including Highlight and Inline Image, etc.
- **Default color, gradient, and duotone settings** (Custom theme palettes/settings are never hidden)
- **Core Block Patterns (WP 5.5+)**
- **Block Directory (WP 5.5+)**
- **Infrequently Used Jetpack Blocks** - See [FAQ for full list of hidden blocks](https://wordpress.org/plugins/mrw-web-design-simple-tinymce/#faq).
Expand All @@ -50,7 +50,7 @@ Due to frequent changes to the block editor, features are only guaranteed for th

**Hidden Core Blocks:**

- **Text & Media Blocks:** Audio, Code, Next Page, Preformatted, Shortcode, Spacer, Table, Verse, Video
- **Text & Media Blocks:** Audio, Classic/Freeform, Code, Details, Footnotes, Next Page, Preformatted, Shortcode, Spacer, Table, Verse, Video
- **Widget Blocks:** Archives, Calendar, Categories, Latest Comments, RSS, Search, Tag Cloud
- **Query-Related Blocks**: Query, Archive Title (Query Title), Post Title, Post Content, Post Author, Post Date, Post Excerpt, Post Featured Image, Post Tags & Categories (Post Terms), Term Description
Page List
Expand All @@ -77,6 +77,16 @@ Visit the GitHub wiki for [examples of filters](https://github.com/mrwweb/mrw-si
1. The Block Editor simplified, here with no colors or drop caps for the Paragraph block.

== Changelog ==
= 2.12.0 (November 3, 2023) =
- WordPress 6.4 compatibility
- Fix error that hid custom theme duotone options
- Fully hide Footnotes inserter unless the block is unhidden via `mrw_hidden_blocks` filter
- Hide "Highlight", "Inline Image", "Inline Code", and "Keyboard" toolbar inline formats. Can be re-enabled via `mrw_hidden_block_editor_settings` filter.
- Hide "Upload" option in "Replace" media menu
- Remove background color options from Cover block placeholder
- Hide new Background Image option on Group block
- Hide new "Text Orientation" / writing mode option

= 2.11.0 (August 21, 2023) =
- **Requires WordPress 6.0**. Legacy code removed
- [New] Show all Post- and Query-related blocks in the Site Editor
Expand All @@ -89,34 +99,9 @@ Visit the GitHub wiki for [examples of filters](https://github.com/mrwweb/mrw-si
- [Meta] Removed "Formerly MRW Web Design Simple TinyMCE" now that the block editor is 4.5 years old!
- 2.11.1: Change `layout-width-height` value in the `mrw_hidden_block_editor_settings` filter to be accurate `layout-width`.

= 2.10.0 (October 15, 2022) =
- Tested up to WordPress 6.1
- Hide new Text Decoration settings by default (enable via `text-decoration` in `mrw_hidden_block_editor_settings`)
- Hide image duotone setting (enable via `duotone` in `mrw_hidden_block_editor_settings`)

= 2.9.0 (May 27, 2022) =
- WordPress 6.0 compatibility fixes: hide new blocks, fix regressions
- [New] Hide the default color palette which was re-added by default in WP 5.8. Can be shown by removing `default-color-palette` value from `mrw_hidden_block_editor_settings` filter
- [New] Hide Avatar, Read More, Comments Query Loop, Post Comments Form, and Post Author Biography blocks
- [Fix] Hide Border Radius in WP 5.9 and 6.0
- [Fix] Prominent contrast error changes in WP 6.0

= 2.8.0 (February 21, 2022) =
* [New] Hide many new default block controls added in WordPress 5.9. All options can be enabled with the [mrw_hidden_block_editor_settings filter](https://github.com/mrwweb/mrw-simplified-editor-wordpress/wiki/Filter-Reference).
* Text Formatting: line-height, font-weight, letter-spacing, and text-transform
* Spacing: gap, margin, padding
* Borders: General, pull-quote
* [Remove] Remove support for hiding paragraph block dropcap setting in WordPress 5.6 and earlier
* [Remove] Remove support for all old versions of `mrw_*` filters using the terms "blacklist" and "disabled"

= 2.7.0 (February 4, 2022) =
* [New] Hide new blocks added in WordPress 5.9: Navigation, Post Pagination, Post Author, Post Comments, Term Description, Wolfram Cloud Embed
* [Dev] Improve inline documentation of new `mrw_hidden_*_blocks` filters added in Simplified Editor 2.5.0
* [Preview] Version 2.8 will continue to hide new settings added in WordPress 5.9: default border controls on pullquote, new typopgraphy settings (e.g. line height, letter spacing), and default padding controls on Group, Cover, and Columns unless themes explicitly opt-in.

= Full Changelog =
* [Changelog on Github](https://github.com/mrwweb/mrw-simplified-editor-wordpress/blob/master/changelog.txt)

== Upgrade Notice ==
= 2.11.0 =
* WP 6.3 Compatibility + Relevant blocks visible in the style editor.
= 2.12.0 =
* WP 6.4 Compatibility + hide various inline formats and placeholder options

0 comments on commit dbad105

Please sign in to comment.