[wp-trac] [WordPress Trac] #62140: Consider allowing themes to register block metadata collections

WordPress Trac noreply at wordpress.org
Thu Oct 24 15:44:07 UTC 2024


#62140: Consider allowing themes to register block metadata collections
--------------------------+---------------------
 Reporter:  flixos90      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.7.1
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by flixos90):

 Replying to [comment:11 dougwollison]:
 > Replying to [comment:10 flixos90]:
 > > Replying to [comment:9 dougwollison]:
 > > > Wait, how is that so disasterous? I'm looking at the source again
 and I'm confused.
 > >
 > > We wouldn't want to allow someone to tamper with how other plugins'
 blocks are registered, it could be used to override the block
 configuration data by other plugins. That might make sense for a project
 you manage, but it would open up lots of doors for malicious intent to any
 plugin modifying another plugin's behavior.
 >
 > But... core literally provides two separate filters to allow messing
 with how blocks are registered. The entire premise of the hook system is
 to allow plugins to modify each other's behaviour, not just core's
 behaviour. I sincerely can't grasp how this is a uniquely dangerous
 scenario.

 Still, that's a different kind of API where that is more explicit. To use
 the new block metadata collection API, you need to create a manifest,
 which you can reasonably do for your plugin, maybe even a few plugins
 manually, but you realistically can't create a manifest that works for all
 blocks from all plugins. Additionally, if it was possible to register a
 collection for `wp-content/plugins`, different plugins might just try to
 override each other. What makes sense for a block type registration filter
 doesn't necessarily make sense here, due to the problems outlined in how
 the API is designed.

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


More information about the wp-trac mailing list