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

WordPress Trac noreply at wordpress.org
Thu Oct 24 02:53:28 UTC 2024


#62140: Consider allowing themes to register block metadata collections
-------------------------+------------------------------
 Reporter:  flixos90     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+------------------------------

Comment (by flixos90):

 Replying to [comment:2 dougwollison]:
 > I want to push for any such restirctions on **where** a block is
 registered from to be removed.

 While registering block types in themes is discouraged (and forbidden for
 .org themes), it's reasonable to expect that it should still be possible,
 just like how all those other things are possible. So I'm onboard for
 adding support to themes (and must-use plugins).


 > If it's updated to allow those too, then at that point why bother
 whitelisting directory at all for a ''single'' variant of the registration
 API?

 The reason those conditions exist has nothing to do with allowlisting in
 the first place. They exist because we need to prevent certain directories
 from being used, for example it needs to be impossible to register e.g.
 the root plugins or root themes directory as a block collection, since
 then all block types from all other plugins would be considered part of
 such a collection. So that part of the behavior needs to be maintained no
 matter what we allowlist. Another example would be if someone tried to
 register the parent directory of the entire WordPress site, that would be
 a problem so it needs to be prevented.

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


More information about the wp-trac mailing list