[wp-trac] [WordPress Trac] #62002: Extend Block Metadata PHP Cache to Third-Party Blocks
WordPress Trac
noreply at wordpress.org
Wed Feb 26 19:38:26 UTC 2025
#62002: Extend Block Metadata PHP Cache to Third-Party Blocks
-------------------------------------------------+-------------------------
Reporter: mreishus | Owner: flixos90
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.7
Component: Editor | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests has-dev- | Focuses:
note | performance
-------------------------------------------------+-------------------------
Comment (by flixos90):
In [changeset:"59874" 59874]:
{{{
#!CommitTicketReference repository="" revision="59874"
Editor: Allow registering block type collections with a single function
call.
[59132] introduced the `wp_register_block_metadata_collection()` function
and underlying `WP_Block_Metadata_Registry` class to allow central
registration of a block metadata PHP manifest file in favor of parsing
individual JSON files. While this improves performance, it only increases
the amount of APIs and code that plugin developers need to use to register
their block types properly.
This changeset introduces a new function
`wp_register_block_types_from_metadata_collection()` that improves the
developer experience of registering block types from a single source, by
handling it in only a single function call.
Developers that already use a generated block metadata PHP manifest file
(e.g. via the `wp-scripts build-blocks-manifest` tool) can now call
`wp_register_block_types_from_metadata_collection()` with that file to
automatically register all block types from that block metadata
collection. Individual calls to `register_block_type()` or
`register_block_type_from_metadata()` are no longer necessary when the new
function is used.
Props flixos90, gziolo, joemcgill, mreishus, mukesh27, swissspidy.
Fixes #62267.
See #62002.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62002#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list