Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
932b136
iAPI: Fix and refactor runtime initialization logic (#71123)
DAreRodz Jan 19, 2026
b74c844
Fix Popover closing unexpectedly when a Menu inside it is closed. (#7…
tellthemachines Oct 22, 2025
8106ac7
Notes position alignment in HTML (#73046)
karthick-murugan Nov 26, 2025
9fd3035
Gutenberg plugin: Override core classic theme styles (#73580)
t-hamano Nov 27, 2025
1ee1107
Block Editor: Restore ToolSelector component for backward compatibili…
t-hamano Nov 26, 2025
547cca6
Accordion Heading: Add default style for classic themes (#73608)
t-hamano Nov 28, 2025
e5fb388
Block JSON schema: add visibility key to supports definition (#73612)
shimotmk Nov 27, 2025
9821297
Color Panel: Ensure minimum height for popover content (#73835)
t-hamano Dec 11, 2025
2535039
Classic Block: Resotre HTML editing option (#73865)
Mamaduka Dec 10, 2025
c8a9c83
Block API: Fallback to all attributes when checking for unmodified bl…
Mamaduka Dec 10, 2025
62a39a5
Global Styles: fix infinite loop in Font Style UI (#73955)
t-hamano Dec 12, 2025
355f828
Terms Query Block: Fix Max terms for non-hierarchical taxonomies (#74…
jillro Dec 22, 2025
1f65a71
Fix: Prevent `accordion-heading` submitting/sending forms (button `ty…
Ninos Dec 23, 2025
4f96e85
Fix: menu_order validation to allow zero and negative values (#74282)
jorgefilipecosta Dec 31, 2025
ac2fd26
iAPI: Update deprecation warning for unique ID format (#74580)
fabiankaegy Jan 21, 2026
e25cc52
Revert "Fixed Media & Text Block - Image not rendered properly on fro…
t-hamano Jan 20, 2026
ad92b8d
Blocks: Always trigger borwser console warnings for blocks with apiVe…
t-hamano Jan 21, 2026
494293c
Follow-up to #73580: Fix classic theme style path
t-hamano Jan 22, 2026
82d197e
Fix parent popover not closing on click outside (#74340)
tellthemachines Jan 7, 2026
695a587
iAPI Router: Prevent router regions with `data-wp-key` from being rec…
t-hamano Jan 23, 2026
0d86008
iAPI Router: Fix initial router regions with `attachTo` being duplica…
DAreRodz Jan 22, 2026
156d5d3
Fix: Fit Text not working on calculated line heights. (#74860)
jorgefilipecosta Jan 23, 2026
58bd57a
Fix: Safari "Edit as HTML" for Fit Text deletes content (#74864)
jorgefilipecosta Jan 23, 2026
2533081
Patterns: restore rename and delete actions for user patterns (#74927)
t-hamano Jan 26, 2026
f61843a
Fix: Stretchy text issue when nested on flex containers. (#73652)
jorgefilipecosta Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/reference-guides/block-api/block-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -1169,3 +1169,18 @@ is only meant for simple text blocks such as paragraphs and headings with a
single `RichText` field. RichText in the `edit` function _must_ have an
`identifier` prop that matches the attribute key of the text, so that it updates
the selection correctly and we know where to split.

## visibility

_**Note:** Since WordPress 6.9._

- Type: `boolean`
- Default value: `true`

By default, a block can be hidden by a user from the block 'Options' dropdown. To disable this behavior, set visibility to false.

```js
supports: {
visibility: false,
}
```
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Use the classic WordPress editor. ([Source](https://github.com/WordPress/gutenbe

- **Name:** core/freeform
- **Category:** text
- **Supports:** ~~className~~, ~~customClassName~~, ~~html~~, ~~lock~~, ~~renaming~~, ~~reusable~~, ~~visibility~~
- **Supports:** ~~className~~, ~~customClassName~~, ~~lock~~, ~~renaming~~, ~~reusable~~, ~~visibility~~
- **Attributes:** content

## Gallery
Expand Down
10 changes: 10 additions & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,16 @@ function gutenberg_register_packages_styles( $styles ) {
);
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );

gutenberg_override_style(
$styles,
'classic-theme-styles',
gutenberg_url( 'build/block-library/classic.css' ),
array(),
$version
);
$styles->add_data( 'classic-theme-styles', 'rtl', 'replace' );
$styles->add_data( 'classic-theme-styles', 'path', gutenberg_dir_path() . 'build/block-library/classic.css' );

gutenberg_override_style(
$styles,
'wp-list-reusable-blocks',
Expand Down
4 changes: 4 additions & 0 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@ _Related_

- <https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore>

### ToolSelector

This component has been deprecated and no longer renders anything.

### transformStyles

Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe( 'BlockControls', () => {
const edit = ( { children } ) => <>{ children }</>;

registerBlockType( 'core/test-block', {
apiVersion: 3,
save: () => {},
category: 'text',
title: 'block title',
Expand Down
10 changes: 10 additions & 0 deletions packages/block-editor/src/components/block-edit/test/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe( 'Edit', () => {
const edit = () => <div data-testid="foo-bar" />;

registerBlockType( 'core/test-block', {
apiVersion: 3,
save: noop,
category: 'text',
title: 'block title',
Expand All @@ -52,6 +53,7 @@ describe( 'Edit', () => {
const save = () => <div data-testid="foo-bar" />;

registerBlockType( 'core/test-block', {
apiVersion: 3,
save,
category: 'text',
title: 'block title',
Expand Down Expand Up @@ -79,6 +81,13 @@ describe( 'Edit', () => {

render( <Edit name="core/test-block" attributes={ attributes } /> );

// This test is for API version 1 blocks, so the console warning is intentional.
// API version 1 blocks automatically receive the default block class name,
// while API version 2+ blocks require useBlockProps() to be used explicitly.
expect( console ).toHaveWarnedWith(
'Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block "core/test-block" is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the `apiVersion` field to 3 and test the block inside the iframe editor.'
);

const editElement = screen.getByTestId( 'foo-bar' );
expect( editElement ).toHaveClass( 'wp-block-test-block' );
expect( editElement ).toHaveClass( 'my-class' );
Expand All @@ -87,6 +96,7 @@ describe( 'Edit', () => {
it( 'should assign context', () => {
const edit = ( { context } ) => context.value;
registerBlockType( 'core/test-block', {
apiVersion: 3,
category: 'text',
title: 'block title',
usesContext: [ 'value' ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@ import {
* Internal dependencies
*/
import { useBlockPreview } from '../';
import { useBlockProps } from '../../block-list/use-block-props';

describe( 'useBlockPreview', () => {
beforeAll( () => {
registerBlockType( 'core/test-block', {
apiVersion: 3,
save: () => (
<div>
<div { ...useBlockProps.save() }>
Test block save view
<button>Button</button>
</div>
),
edit: () => (
<div>
Test block edit view
<button>Button</button>
</div>
),
edit: function Edit() {
return (
<div { ...useBlockProps() }>
Test block edit view
<button>Button</button>
</div>
);
},
category: 'text',
title: 'test block',
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe( 'BlockSwitcher', () => {
clientId: 'a1303fd6-3e60-4fff-a770-0e0ea656c5b9',
};
const headingBlockType = {
apiVersion: 3,
category: 'text',
title: 'Heading',
edit: () => {},
Expand All @@ -54,6 +55,7 @@ describe( 'BlockSwitcher', () => {
},
};
const paragraphBlockType = {
apiVersion: 3,
category: 'text',
title: 'Paragraph',
edit: () => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
describe( 'use-transformed-patterns', () => {
beforeAll( () => {
registerBlockType( 'core/test-block-1', {
apiVersion: 3,
attributes: {
align: {
type: 'string',
Expand All @@ -36,6 +37,7 @@ describe( 'use-transformed-patterns', () => {
title: 'test block 1',
} );
registerBlockType( 'core/test-block-2', {
apiVersion: 3,
attributes: {
align: { type: 'string' },
content: { type: 'boolean' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe( 'BlockSwitcher - utils', () => {
describe( 'getRetainedBlockAttributes', () => {
beforeAll( () => {
registerBlockType( 'core/test-block-1', {
apiVersion: 3,
attributes: {
align: {
type: 'string',
Expand All @@ -34,6 +35,7 @@ describe( 'BlockSwitcher - utils', () => {
title: 'test block 1',
} );
registerBlockType( 'core/test-block-2', {
apiVersion: 3,
attributes: {
align: { type: 'string' },
content: { type: 'boolean' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ $swatch-gap: 12px;
}

.block-editor-panel-color-gradient-settings__dropdown-content {
// Set minimum height to prevent content from being squashed when
// the popover is triggered near the bottom of the page, and flip
// the position accordingly.
min-height: 160px;

.block-editor-color-gradient-control__panel {
$panelPadding: $grid-unit-20;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ const popoverProps = {
placement: 'left-start',
offset: 36,
shift: true,
flip: true,
resize: false,
};

const { Tabs } = unlock( componentsPrivateApis );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ describe( 'getGlobalStylesChanges and utils', () => {

beforeEach( () => {
registerBlockType( 'core/test-fiori-di-zucca', {
apiVersion: 3,
save: () => {},
category: 'text',
title: 'Test pumpkin flowers',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
__experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useCallback, useMemo, useEffect } from '@wordpress/element';
import { useCallback, useMemo } from '@wordpress/element';

/**
* Internal dependencies
Expand All @@ -27,6 +27,7 @@ import {
getMergedFontFamiliesAndFontFamilyFaces,
findNearestStyleAndWeight,
} from './typography-utils';
import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';

const MIN_TEXT_COLUMNS = 1;
const MAX_TEXT_COLUMNS = 6;
Expand Down Expand Up @@ -194,15 +195,57 @@ export default function TypographyPanel( {
const slug = fontFamilies?.find(
( { fontFamily: f } ) => f === newValue
)?.slug;
onChange(
setImmutably(
value,
[ 'typography', 'fontFamily' ],
slug
? `var:preset|font-family|${ slug }`
: newValue || undefined
)
let updatedValue = setImmutably(
value,
[ 'typography', 'fontFamily' ],
slug ? `var:preset|font-family|${ slug }` : newValue || undefined
);

// Check if current font style/weight are available in the new font family.
const newFontFamilyFaces =
fontFamilies?.find( ( { fontFamily: f } ) => f === newValue )
?.fontFace ?? [];
const { fontStyles, fontWeights } =
getFontStylesAndWeights( newFontFamilyFaces );
const hasFontStyle = fontStyles?.some(
( { value: fs } ) => fs === fontStyle
);
const hasFontWeight = fontWeights?.some(
( { value: fw } ) => fw?.toString() === fontWeight?.toString()
);

// Find the nearest available font style/weight if not available.
if ( ! hasFontStyle || ! hasFontWeight ) {
const { nearestFontStyle, nearestFontWeight } =
findNearestStyleAndWeight(
newFontFamilyFaces,
fontStyle,
fontWeight
);
if ( nearestFontStyle || nearestFontWeight ) {
// Update to the nearest available font style/weight in the new font family.
updatedValue = {
...updatedValue,
typography: {
...updatedValue?.typography,
fontStyle: nearestFontStyle || undefined,
fontWeight: nearestFontWeight || undefined,
},
};
} else if ( fontStyle || fontWeight ) {
// Reset if no available styles/weights found.
updatedValue = {
...updatedValue,
typography: {
...updatedValue?.typography,
fontStyle: undefined,
fontWeight: undefined,
},
};
}
}

onChange( updatedValue );
};
const hasFontFamily = () => !! value?.typography?.fontFamily;
const resetFontFamily = () => setFontFamily( undefined );
Expand Down Expand Up @@ -260,11 +303,6 @@ export default function TypographyPanel( {
const hasFontWeights = settings?.typography?.fontWeight;
const fontStyle = decodeValue( inheritedValue?.typography?.fontStyle );
const fontWeight = decodeValue( inheritedValue?.typography?.fontWeight );
const { nearestFontStyle, nearestFontWeight } = findNearestStyleAndWeight(
fontFamilyFaces,
fontStyle,
fontWeight
);
const setFontAppearance = useCallback(
( { fontStyle: newFontStyle, fontWeight: newFontWeight } ) => {
// Only update the font style and weight if they have changed.
Expand All @@ -287,24 +325,6 @@ export default function TypographyPanel( {
setFontAppearance( {} );
}, [ setFontAppearance ] );

// Check if previous font style and weight values are available in the new font family.
useEffect( () => {
if ( nearestFontStyle && nearestFontWeight ) {
setFontAppearance( {
fontStyle: nearestFontStyle,
fontWeight: nearestFontWeight,
} );
} else {
// Reset font appearance if there are no available styles or weights.
resetFontAppearance();
}
}, [
nearestFontStyle,
nearestFontWeight,
resetFontAppearance,
setFontAppearance,
] );

// Line Height
const hasLineHeightEnabled = useHasLineHeightControl( settings );
const lineHeight = decodeValue( inheritedValue?.typography?.lineHeight );
Expand Down
4 changes: 4 additions & 0 deletions packages/block-editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,7 @@ export { useBlockEditingMode } from './block-editing-mode';
export { default as BlockEditorProvider } from './provider';
export { useSettings, useSetting } from './use-settings';
export { useBlockCommands } from './use-block-commands';

// This component is no longer used in Gutenberg,
// but kept for backwards compatibility.
export { default as ToolSelector } from './tool-selector';
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe( 'InnerBlocks', () => {

it( 'should return element as string, with inner blocks', () => {
registerBlockType( 'core/fruit', {
apiVersion: 3,
category: 'text',

title: 'fruit',
Expand Down Expand Up @@ -62,6 +63,7 @@ describe( 'InnerBlocks', () => {

it( 'should force serialize for invalid block with inner blocks', () => {
const blockType = {
apiVersion: 3,
attributes: {
throw: {
type: 'boolean',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const TestWrapper = withRegistryProvider( ( props ) => {
describe( 'useBlockSync hook', () => {
beforeAll( () => {
registerBlockType( 'test/test-block', {
apiVersion: 3,
title: 'Test block',
attributes: {
foo: { type: 'number' },
Expand Down
19 changes: 19 additions & 0 deletions packages/block-editor/src/components/tool-selector/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* WordPress dependencies
*/
import deprecated from '@wordpress/deprecated';
import { forwardRef } from '@wordpress/element';

function ToolSelector() {
deprecated( 'wp.blockEditor.ToolSelector', {
since: '6.9',
hint: 'The ToolSelector component no longer renders anything.',
} );

return null;
}

/**
* This component has been deprecated and no longer renders anything.
*/
export default forwardRef( ToolSelector );
Loading
Loading