[wp-trac] [WordPress Trac] #62291: Reuse block metadata in WP_Theme_JSON::get_valid_block_style_variations() for better performance
WordPress Trac
noreply at wordpress.org
Thu Oct 24 06:31:22 UTC 2024
#62291: Reuse block metadata in WP_Theme_JSON::get_valid_block_style_variations()
for better performance
-------------------------+-------------------------
Reporter: mukesh27 | Owner: mukesh27
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.8
Component: Editor | Version: 6.6
Severity: normal | Keywords: needs-patch
Focuses: performance |
-------------------------+-------------------------
In `WP_Theme_JSON::get_valid_block_style_variations()`, the method was
calling `self::get_blocks_metadata()` even though the metadata was already
retrieved in the parent function. This update reuses the existing block
metadata instead of calling it again.
A new optional parameter, `$blocks_metadata`, has been added to the
function, allowing it to use pre-fetched metadata when available,
improving efficiency.
Fewer `self::get_blocks_metadata()` calls mean faster processing,
especially in themes with many blocks.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62291>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list