[wp-trac] [WordPress Trac] #54684: Add ability to filter blocks in WP_Block_List

WordPress Trac noreply at wordpress.org
Tue Jan 4 14:54:13 UTC 2022

#54684: Add ability to filter blocks in WP_Block_List
 Reporter:  afragen      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.9
Component:  Menus        |     Version:  5.5
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  administration

Comment (by hellofromTonya):

 Hey @afragen,

 In the meantime, could you use the `'block_type_metadata_setting'` filter
 which is called when `register_block_core_navigation()` which then invokes
 `register_block_type_from_metadata()` which fires that filter. The
 `WP_Block_Type::$render_callback` is registered to the
 `render_block_core_navigation()`. Did a little a test to see what the data
 looks like with that filter

 Not sure if it gives you exactly what you need, but might open a
 possibility to discover other available filters as a stop gap.

Ticket URL: <https://core.trac.wordpress.org/ticket/54684#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list