Opened 6 months ago
Last modified 5 months ago
#61405 new defect (bug)
Residual of block found in `get_blocks_metadata` even when block is unregistered using `unregister_block_type()`.
Reported by: | thekt12 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
The get_blocks_metadata() function retrieves all registered blocks using WP_Block_Type_Registry::get_all_registered(). It updates its internal static variable with new blocks but does not account for blocks that have been unregistered. Consequently, residual blocks remain in the static variable and are processed in functions consuming get_blocks_metadata(), such as wp_add_global_styles_for_blocks
. This oversight can lead to unnecessary processing overhead.
Change History (5)
This ticket was mentioned in PR #6764 on WordPress/wordpress-develop by @thekt12.
6 months ago
#1
- Keywords has-patch added
POC for 61405
Trac ticket: https://core.trac.wordpress.org/ticket/61405