[wp-trac] [WordPress Trac] #62046: `render_block_context` filter works differently on top-level vs. inner blocks

WordPress Trac noreply at wordpress.org
Mon Nov 11 18:39:04 UTC 2024


#62046: `render_block_context` filter works differently on top-level vs. inner
blocks
--------------------------------------+---------------------
 Reporter:  dlh                       |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  6.8
Component:  Editor                    |     Version:  5.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+---------------------

Comment (by joemcgill):

 The way that I would expect the context API to work is that any time
 information is added to a block's `$context` prop (either via a block's
 `provides_context` property or by being added via a filter), that
 information is added to the `$available_context` that is available to that
 block and any of its ancestors, regardless of whether a block is top level
 or not.

 A block's `$context` value (regardless of whether it's top level or not)
 will include the subset of `$available_context` that the block itself
 supports (e.g., `uses_context`) and any additional context that has been
 dynamically added via a filter of that block's context.

 In addition, any context that is added to a block via a filter should be
 included in that block's `$available_context` which gets passed to any of
 that block's ancestors.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62046#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list