From 0d21750d06ea5922e4fc68bcc066a6d95de2d9e6 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:48:35 +1000 Subject: [PATCH 1/2] Rename blockStatesEnabled setting to blockStatesEditingEnabled --- .../disable-editor-functionality.md | 2 +- .../filters/editor-filters.md | 4 +-- packages/block-editor/CHANGELOG.md | 2 +- packages/block-editor/README.md | 2 +- .../src/components/block-inspector/index.js | 10 +++--- packages/block-editor/src/store/defaults.js | 4 +-- packages/editor/CHANGELOG.md | 2 +- .../src/components/global-styles/index.js | 9 ++--- .../provider/use-block-editor-settings.js | 2 +- packages/editor/src/store/defaults.js | 36 +++++++++---------- 10 files changed, 37 insertions(+), 36 deletions(-) diff --git a/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md b/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md index 21e453a76c9a9e..0020b21761eb90 100644 --- a/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md +++ b/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md @@ -127,7 +127,7 @@ The state controls for blocks in the block inspector and Global Styles let users ```php function example_disable_block_states_editing( $settings ) { - $settings[ 'blockStatesEnabled' ] = false; + $settings[ 'blockStatesEditingEnabled' ] = false; return $settings; } diff --git a/docs/reference-guides/filters/editor-filters.md b/docs/reference-guides/filters/editor-filters.md index 8064e60b826fa9..756621a4179a4e 100644 --- a/docs/reference-guides/filters/editor-filters.md +++ b/docs/reference-guides/filters/editor-filters.md @@ -76,13 +76,13 @@ function example_disable_responsive_editing( $settings ) { ### Restrict block states editing -The `blockStatesEnabled` setting, which defaults to `true`, controls whether state controls for blocks are available in the block inspector and Global Styles. When it is `false`, those controls are not rendered, so users cannot apply block styles to states from those UIs. Viewport state controls are unaffected and remain controlled by `responsiveEditingEnabled`. State styles already saved in `theme.json`, in Global Styles, or in a block's `style` attribute are unaffected. +The `blockStatesEditingEnabled` setting, which defaults to `true`, controls whether state controls for blocks are available in the block inspector and Global Styles. When it is `false`, those controls are not rendered, so users cannot apply block styles to states from those UIs. Viewport state controls are unaffected and remain controlled by `responsiveEditingEnabled`. State styles already saved in `theme.json`, in Global Styles, or in a block's `style` attribute are unaffected. ```php add_filter( 'block_editor_settings_all', 'example_disable_block_states_editing' ); function example_disable_block_states_editing( $settings ) { - $settings['blockStatesEnabled'] = false; + $settings['blockStatesEditingEnabled'] = false; return $settings; } ``` diff --git a/packages/block-editor/CHANGELOG.md b/packages/block-editor/CHANGELOG.md index b051f1aaae5efb..caac0cafd05c8b 100644 --- a/packages/block-editor/CHANGELOG.md +++ b/packages/block-editor/CHANGELOG.md @@ -7,7 +7,7 @@ - Inspector controls in the standard block-supports panels (Typography, Dimensions, Border, Color, Background, Filters) now reflect the value a block inherits from Global Styles when no local override is set. Inherited controls show that value at rest (as a placeholder, preselected option, or resolved value) and mark the label with a dotted underline; setting a local override reveals a reset affordance that clears the override back to the inherited value ([#77894](https://github.com/WordPress/gutenberg/pull/77894)). - Inherited Global Styles now resolve per-level heading element styles for the heading-family blocks (`core/heading`, `core/site-title`, `core/post-title`, `core/query-title`, `core/comments-title`, `core/term-name`, `core/site-tagline`, `core/accordion-heading`), so inspector controls reflect values set on a specific heading level (`styles.elements.h1`–`h6`) in addition to the shared `heading` element. A block rendered at level 0 (a paragraph) folds no heading element styles; `core/accordion-heading` has no level-0 state and takes its level from the parent Accordion's block context ([#80495](https://github.com/WordPress/gutenberg/pull/80495)). - Inherited Global Styles now resolve the `link` element (`styles.elements.link`) for whole-block link blocks — those that render as a link — so their inspector controls reflect inherited link styles, mirroring the `button` element treatment for `core/button`. Covers `core/read-more`, `core/loginout`, `core/post-navigation-link`, `core/query-pagination-next`, `core/query-pagination-previous`, `core/query-pagination-numbers`, `core/comments-pagination-next`, `core/comments-pagination-previous`, `core/comments-pagination-numbers`, `core/comment-edit-link`, `core/comment-reply-link`, and `core/post-comments-link` [#80607](https://github.com/WordPress/gutenberg/pull/80607)). -- Add support for the `blockStatesEnabled` editor setting, which hides state controls for blocks when set to `false` ([#80956](https://github.com/WordPress/gutenberg/pull/80956)). +- Add support for the `blockStatesEditingEnabled` editor setting, which hides state controls for blocks when set to `false` ([#80956](https://github.com/WordPress/gutenberg/pull/80956)). ### Internal diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index bc10ad32da5981..9f19f935901985 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -898,7 +898,7 @@ _Properties_ - _titlePlaceholder_ `string`: Empty title placeholder - _canLockBlocks_ `boolean`: Whether the user can manage Block Lock state - _codeEditingEnabled_ `boolean`: Whether or not the user can switch to the code editor -- _blockStatesEnabled_ `boolean`: Whether or not block style states editing is enabled +- _blockStatesEditingEnabled_ `boolean`: Whether or not block style states editing is enabled - _generateAnchors_ `boolean`: Enable/Disable auto anchor generation for Heading blocks - _enableOpenverseMediaCategory_ `boolean`: Enable/Disable the Openverse media category in the inserter. - _clearBlockSelection_ `boolean`: Whether the block editor should clear selection on mousedown when a block is not clicked. diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index b480a77396bcec..b8b3c82e5cc8e3 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -176,7 +176,7 @@ function BlockInspector() { selectedBlockStyleState, showStateOnCanvas, isResponsiveEditing, - blockStatesEnabled, + blockStatesEditingEnabled, } = useSelect( ( select ) => { const { getSettings, @@ -231,7 +231,7 @@ function BlockInspector() { _renderedBlockClientId ), isResponsiveEditing: _isResponsiveEditing(), - blockStatesEnabled: getSettings().blockStatesEnabled, + blockStatesEditingEnabled: getSettings().blockStatesEditingEnabled, }; }, [] ); @@ -367,7 +367,7 @@ function BlockInspector() { selectedBlockStyleState={ selectedBlockStyleState } showStateOnCanvas={ showStateOnCanvas } isResponsiveEditing={ isResponsiveEditing } - blockStatesEnabled={ blockStatesEnabled } + blockStatesEditingEnabled={ blockStatesEditingEnabled } isBlockStyleStateSelected={ isBlockStyleStateSelected } /> @@ -424,7 +424,7 @@ const BlockInspectorSingleBlock = ( { selectedBlockStyleState, showStateOnCanvas, isResponsiveEditing, - blockStatesEnabled = true, + blockStatesEditingEnabled = true, } ) => { const listViewRef = useRef( null ); const hasMultipleTabs = availableTabs?.length > 1; @@ -473,7 +473,7 @@ const BlockInspectorSingleBlock = ( { clientId={ renderedBlockClientId } controls={ blockEditingMode === 'default' && - blockStatesEnabled && ( + blockStatesEditingEnabled && ( { const { canUser } = select( coreStore ); @@ -79,7 +80,7 @@ function useServerData( settings ) { serverSettings, fontLibraryEnabled, responsiveEditingEnabled, - blockStatesEnabled, + blockStatesEditingEnabled, }; } @@ -101,7 +102,7 @@ export default function GlobalStylesUIWrapper( { serverSettings, fontLibraryEnabled, responsiveEditingEnabled, - blockStatesEnabled, + blockStatesEditingEnabled, } = useServerData( settings ); // Show loading state while data is being fetched @@ -124,7 +125,7 @@ export default function GlobalStylesUIWrapper( { showResponsiveStateControls={ showResponsiveStateControls && responsiveEditingEnabled } - showBlockStateControls={ blockStatesEnabled } + showBlockStateControls={ blockStatesEditingEnabled } /> Panels to enable the Custom Fields panel is not displayed. - * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API. - * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage. - * @property {Array?} availableTemplates The available post templates - * @property {boolean} disablePostFormats Whether or not the post formats are disabled - * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions - * @property {number} maxUploadFileSize Maximum upload file size - * @property {boolean} supportsLayout Whether the editor supports layouts. + * @property {boolean|Array} allowedBlockTypes Allowed block types + * @property {boolean} richEditingEnabled Whether rich editing is enabled or not + * @property {boolean} codeEditingEnabled Whether code editing is enabled or not + * @property {boolean} responsiveEditingEnabled Whether responsive (per-viewport) style editing is enabled or not + * @property {boolean} blockStatesEditingEnabled Whether block style states editing is enabled or not + * @property {boolean} fontLibraryEnabled Whether the font library is enabled or not. + * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not. + * true = the user has opted to show the Custom Fields panel at the bottom of the editor. + * false = the user has opted to hide the Custom Fields panel at the bottom of the editor. + * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed. + * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API. + * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage. + * @property {Array?} availableTemplates The available post templates + * @property {boolean} disablePostFormats Whether or not the post formats are disabled + * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions + * @property {number} maxUploadFileSize Maximum upload file size + * @property {boolean} supportsLayout Whether the editor supports layouts. */ export const EDITOR_SETTINGS_DEFAULTS = { ...SETTINGS_DEFAULTS, @@ -30,7 +30,7 @@ export const EDITOR_SETTINGS_DEFAULTS = { richEditingEnabled: true, codeEditingEnabled: true, responsiveEditingEnabled: true, - blockStatesEnabled: true, + blockStatesEditingEnabled: true, fontLibraryEnabled: true, enableCustomFields: undefined, defaultRenderingMode: 'post-only', From 554dc8664bffdcb515ec3d5aa09dcb8a1492bd67 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:57:55 +1000 Subject: [PATCH 2/2] Update changelog entries --- packages/block-editor/CHANGELOG.md | 2 +- packages/editor/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/CHANGELOG.md b/packages/block-editor/CHANGELOG.md index caac0cafd05c8b..f9b5c54a873b89 100644 --- a/packages/block-editor/CHANGELOG.md +++ b/packages/block-editor/CHANGELOG.md @@ -7,7 +7,7 @@ - Inspector controls in the standard block-supports panels (Typography, Dimensions, Border, Color, Background, Filters) now reflect the value a block inherits from Global Styles when no local override is set. Inherited controls show that value at rest (as a placeholder, preselected option, or resolved value) and mark the label with a dotted underline; setting a local override reveals a reset affordance that clears the override back to the inherited value ([#77894](https://github.com/WordPress/gutenberg/pull/77894)). - Inherited Global Styles now resolve per-level heading element styles for the heading-family blocks (`core/heading`, `core/site-title`, `core/post-title`, `core/query-title`, `core/comments-title`, `core/term-name`, `core/site-tagline`, `core/accordion-heading`), so inspector controls reflect values set on a specific heading level (`styles.elements.h1`–`h6`) in addition to the shared `heading` element. A block rendered at level 0 (a paragraph) folds no heading element styles; `core/accordion-heading` has no level-0 state and takes its level from the parent Accordion's block context ([#80495](https://github.com/WordPress/gutenberg/pull/80495)). - Inherited Global Styles now resolve the `link` element (`styles.elements.link`) for whole-block link blocks — those that render as a link — so their inspector controls reflect inherited link styles, mirroring the `button` element treatment for `core/button`. Covers `core/read-more`, `core/loginout`, `core/post-navigation-link`, `core/query-pagination-next`, `core/query-pagination-previous`, `core/query-pagination-numbers`, `core/comments-pagination-next`, `core/comments-pagination-previous`, `core/comments-pagination-numbers`, `core/comment-edit-link`, `core/comment-reply-link`, and `core/post-comments-link` [#80607](https://github.com/WordPress/gutenberg/pull/80607)). -- Add support for the `blockStatesEditingEnabled` editor setting, which hides state controls for blocks when set to `false` ([#80956](https://github.com/WordPress/gutenberg/pull/80956)). +- Add support for the `blockStatesEditingEnabled` editor setting, which hides state controls for blocks when set to `false` ([#80956](https://github.com/WordPress/gutenberg/pull/80956), [#81058](https://github.com/WordPress/gutenberg/pull/81058)). ### Internal diff --git a/packages/editor/CHANGELOG.md b/packages/editor/CHANGELOG.md index 99d5043d20b439..39e0e09f20a83c 100644 --- a/packages/editor/CHANGELOG.md +++ b/packages/editor/CHANGELOG.md @@ -10,7 +10,7 @@ - The "Apply globally" control now opens a review modal so you can choose which of a block's modified styles are pushed to Global Styles, showing each style's current and new value ([#79839](https://github.com/WordPress/gutenberg/pull/79839)). - Add a `responsiveEditingEnabled` editor setting, defaulting to `true`, which hides the "Responsive styles" option in the View menu and the viewport state control in Global Styles when set to `false` ([#80814](https://github.com/WordPress/gutenberg/pull/80814)). -- Add a `blockStatesEditingEnabled` editor setting, defaulting to `true`, which hides state controls for blocks in the block inspector and Global Styles when set to `false` ([#80956](https://github.com/WordPress/gutenberg/pull/80956)). +- Add a `blockStatesEditingEnabled` editor setting, defaulting to `true`, which hides state controls for blocks in the block inspector and Global Styles when set to `false` ([#80956](https://github.com/WordPress/gutenberg/pull/80956), [#81058](https://github.com/WordPress/gutenberg/pull/81058)). ### Bug Fixes