Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 weeks 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: trunk
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.


4 weeks 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
3 weeks ago

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

#3 @isabel_brison
3 weeks 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:


3 weeks ago
#4

Committed in r58246.

#5 @swissspidy
3 weeks 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.