#62291 closed enhancement (fixed)
Reuse block metadata in WP_Theme_JSON::get_valid_block_style_variations() for better performance
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.8 | Priority: | normal |
| Severity: | normal | Version: | 6.6 |
| Component: | Editor | Keywords: | has-patch |
| Focuses: | performance | Cc: |
Description
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.
Attachments (2)
Change History (10)
This ticket was mentioned in PR #7586 on WordPress/wordpress-develop by @mukesh27.
17 months ago
#1
- Keywords has-patch added; needs-patch removed
@mukesh27 commented on PR #7586:
17 months ago
#2
@ramonopoly commented on PR #7586:
17 months ago
#3
Gutenberg backport PR:
@ramonopoly commented on PR #7586:
16 months ago
#4
Is this ready to be committed? The Gutenberg backport PR is merged.
@mukesh27 commented on PR #7586:
16 months ago
#5
Is this ready to be committed? The Gutenberg backport PR is merged.
Yes. If you have moment then commit it.
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
16 months ago
@ramonopoly commented on PR #7586:
16 months ago
#8
Committed in r59359 / 5ff971744e4b2d246c66f58d436cac5eff2a0662
Yes please if you have moment. Thanks