Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#61274 closed enhancement (fixed)

Block Styles: Allow registration across multiple block types at once

Reported by: aaronrobertshaw's profile aaronrobertshaw Owned by: isabel_brison's profile isabel_brison
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.6
Component: Editor Keywords: gutenberg-merge has-patch has-unit-tests
Focuses: Cc:

Description

This ticket tracks the backporting of PHP files for the following Gutenberg changes:

https://github.com/WordPress/gutenberg/pull/61029

The Gutenberg PR linked above was forced to add a new global function because the core WP_Block_Styles_Registry class was marked as final. The backport for this will involve updating the WP_Block_Styles_Registry class directly with matching functionality.

Included is the addition of style_data within the supported style properties. The style_data property is a theme.json shaped array which will be used by the new section styling feature to generate a dynamic stylesheet for the block style.

Change History (5)

This ticket was mentioned in PR #6609 on WordPress/wordpress-develop by @aaronrobertshaw.


5 months ago
#1

  • Keywords has-patch has-unit-tests added

Adds to core the functionality from:

The Gutenberg PR linked above was forced to add a new global function because the core WP_Block_Styles_Registry class was marked as final. This backport involves updating the WP_Block_Styles_Registry class directly with matching functionality.

Included is the addition of style_data within the supported style properties. The style_data property is a theme.json shaped array that will be used by the new section styling feature to generate a dynamic stylesheet for the block style.

Trac ticket: https://core.trac.wordpress.org/ticket/61274

#2 @isabel_brison
5 months ago

  • Milestone changed from Awaiting Review to 6.6
  • Version set to trunk

#3 @isabel_brison
5 months ago

  • Owner set to isabel_brison
  • Resolution set to fixed
  • Status changed from new to closed

In 58246:

Editor: allow registering block styles for multiple block types.

Updates the WP_Block_Styles_Registry class to allow registering an array of blocks.

Props aaronrobertshaw, talldanwp, isabel_brison.
Fixes #61274.

@isabel_brison commented on PR #6609:


5 months ago
#4

Committed in r58246.

#5 @swissspidy
5 months ago

In 58247:

Editor: Improve types in docblock after [58246].

Makes it clearer that an array of strings is expected.

See #61274.

Note: See TracTickets for help on using tickets.