Commit 5ff9717
committed
Performance: reuse block metadata in
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.
Props mukesh27, ramonopoly, aaronrobertshaw, flixos90.
Fixes #62291.
git-svn-id: https://develop.svn.wordpress.org/trunk@59359 602fd350-edb4-49c9-b593-d223f7449a82WP_Theme_JSON::get_valid_block_style_variations()
1 parent eab73a7 commit 5ff9717
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
| 760 | + | |
| 761 | + | |
761 | 762 | | |
762 | | - | |
| 763 | + | |
763 | 764 | | |
764 | 765 | | |
765 | 766 | | |
| |||
3482 | 3483 | | |
3483 | 3484 | | |
3484 | 3485 | | |
3485 | | - | |
| 3486 | + | |
| 3487 | + | |
3486 | 3488 | | |
3487 | | - | |
| 3489 | + | |
3488 | 3490 | | |
3489 | 3491 | | |
3490 | 3492 | | |
| |||
4531 | 4533 | | |
4532 | 4534 | | |
4533 | 4535 | | |
| 4536 | + | |
4534 | 4537 | | |
| 4538 | + | |
4535 | 4539 | | |
4536 | 4540 | | |
4537 | | - | |
| 4541 | + | |
4538 | 4542 | | |
4539 | | - | |
| 4543 | + | |
| 4544 | + | |
4540 | 4545 | | |
4541 | 4546 | | |
4542 | 4547 | | |
| |||
0 commit comments