[wp-trac] [WordPress Trac] #61280: Block Variations: Allow server-side registration via variations.php
WordPress Trac
noreply at wordpress.org
Wed Jul 24 14:10:15 UTC 2024
#61280: Block Variations: Allow server-side registration via variations.php
-------------------------------------------------+-------------------------
Reporter: Bernhard Reiter | Owner: bernhard-
| reiter
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.7
Component: Editor | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note |
-------------------------------------------------+-------------------------
Changes (by Bernhard Reiter):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"58801" 58801]:
{{{
#!CommitTicketReference repository="" revision="58801"
block.json: Allow passing PHP filename as `variations` field.
Previously, the `variations` field in a block.json file could be used to
provide a static list of the block's variations (i.e., an array).
Alternatively, the block's `variation_callback` could be set during
server-side block registration to point to a PHP function to generate
those variations.
This changeset makes it so that the block.json `variations` field can be
alternatively set to a string, which will be interpreted as the filename
of a PHP file that generates the variations.
It is loosely modeled after [54132], which introduced the `render` field
for `block.json`, as a way to point to a PHP file instead of providing a
`render_callback`.
Props bernhard-reiter, gziolo.
Fixes #61280.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61280#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list