[wp-trac] [WordPress Trac] #50653: Remove the _doing_it_wrong from WP_Block_Patterns_Registry::unregister()
WordPress Trac
noreply at wordpress.org
Mon Jul 13 21:51:41 UTC 2020
#50653: Remove the _doing_it_wrong from WP_Block_Patterns_Registry::unregister()
--------------------------+-------------------------------------
Reporter: johnbillion | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: trunk
Severity: normal | Keywords: needs-patch 2nd-opinion
Focuses: |
--------------------------+-------------------------------------
There's a `_doing_it_wrong()` call inside
`WP_Block_Patterns_Registry::unregister()` when you try to unregister a
block pattern that doesn't exist.
IMO this is incorrect usage of `_doing_it_wrong()` because the function
hasn't been incorrectly called, it's just been called with invalid data.
----
In addition, the `register()` and `unregister()` functions in this class
ought to be returning a `WP_Error` instead of boolean `false`. Should we
improve this for 5.5?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50653>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list