[wp-trac] [WordPress Trac] #53238: Blocks: Add support for `variations in `block.json` file
WordPress Trac
noreply at wordpress.org
Thu May 20 13:14:11 UTC 2021
#53238: Blocks: Add support for `variations in `block.json` file
-------------------------+----------------------------
Reporter: gziolo | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Editor | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+----------------------------
In #52688 @gwwar added support for `variations` for block types. They are
also exposed with the REST APi endpoint for blocks. The last remaining
tasks is to add support `variations` handling for `block.json` file when
processing with `register_block_type`. We postponed it initially because
there are 3 fields for every translation that need to be translated. It's
more complex than `styles`:
https://github.com/WordPress/wordpress-
develop/blob/fb7ecd92acef6c813c1fde6d9d24a21e02340689/src/wp-
includes/blocks.php#L255-L270
Ideally, we reuse the schema used in JavaScript:
https://github.com/WordPress/gutenberg/blob/trunk/packages/blocks/src/api
/i18n-block.json
and port the implementation used there that works with the schema making
future changes a simple change in the config file:
https://github.com/WordPress/gutenberg/blob/4ff70e6f3ad45cd0e77d7cbb77f7912e5844cba7/packages/blocks/src/api/registration.js#L384-L425
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53238>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list