[wp-trac] [WordPress Trac] #55655: 6.0: Throw a _doing_it_wrong in register_block_pattern if not registered on `init` hook.

WordPress Trac noreply at wordpress.org
Wed May 4 12:33:59 UTC 2022


#55655: 6.0: Throw a _doing_it_wrong in register_block_pattern if not registered on
`init` hook.
-------------------------------------+-------------------------------------
 Reporter:  johnstonphilip           |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  6.1
Component:  Editor                   |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-unit-      |     Focuses:  administration, rest-
  tests                              |  api, coding-standards
-------------------------------------+-------------------------------------

Comment (by hellofromTonya):

 To help contributors and followers, the main conversation for this issue
 is in this Gutenberg issue
 https://github.com/WordPress/gutenberg/issues/40736.

 For the BC concerns, please refer to
 [https://github.com/WordPress/gutenberg/issues/40736#issuecomment-1116902153
 @peterwilsoncc's comment in that issue]:
 >WordPress has a core philosophy to maintain backward compatibility, so
 neither a doing it wrong call or saying it's not possible is the answer.
 Something needs to be fixed.
 >
 >[https://github.com/WordPress/gutenberg/commit/bdd024e0d57afefa7b83c6822da1e2c6d13cd795
 bdd024e] removed examples of Gutenberg registering block patterns on hooks
 other than init. Extenders learnt to use current_screen from Core &
 Gutenberg.

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


More information about the wp-trac mailing list