Blocks: Add isDefault to server side block styles registry #30356
Labels
[Feature] Theme Style Variations
Related to style variations provided by block themes
[Type] Enhancement
A suggestion for improvement.
[Type] WP Core Ticket
Requires an upstream change from WordPress. Core Trac ticket should be linked.
What problem does this address?
As documented here, block styles can be registered both server side (using PHP method
register_block_style
) and client side (usingwp.blocks.registerBlockStyle
).While server-side registration is a convenient method to easily register new block styles, it lacks the ability to register a style as the default one.
As an example, something that could easily be achieved like this in JS, is not doable in PHP
What is your proposed solution?
Extend
register_block_style
to also acceptisDefault
.(it would probably require to change core code in https://github.com/WordPress/WordPress/blob/59d32bfe24cee58554ac82573d8a69dd6b6749ab/wp-includes/script-loader.php#L2311 )
The text was updated successfully, but these errors were encountered: