[wp-trac] [WordPress Trac] #61405: Residual of block found in `get_blocks_metadata` even when block is unregistered using `unregister_block_type()`.

WordPress Trac noreply at wordpress.org
Mon Jun 10 10:58:08 UTC 2024


#61405: Residual of block found in `get_blocks_metadata` even when block is
unregistered using `unregister_block_type()`.
--------------------------+-----------------------------
 Reporter:  thekt12       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61405>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list