Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#61274 closed enhancement (fixed)

Block Styles: Allow registration across multiple block types at once

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

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.


2 years 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
2 years ago

  • Milestone Awaiting Review → 6.6
  • Version → trunk

#3 @isabel_brison
2 years ago

  • Owner set to isabel_brison
  • Resolution → fixed
  • Status new → 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:


2 years ago
#4

Committed in r58246.

#5 @swissspidy
2 years 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.