Opened 6 weeks ago
Closed 2 weeks ago
#64072 closed defect (bug) (fixed)
Improve error message in `WP_Block_Templates_Registry::unregister()` to include template name
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 6.7 |
| Component: | Editor | Keywords: | has-patch has-unit-tests |
| Focuses: | template | Cc: |
Description
Currently, when attempting to unregister a non-existent block template, WP_Block_Templates_Registry::unregister() returns a generic error message without reference to the template name. It use __( 'Template "%s" is not registered.' ) in error message without using template name.
Change History (2)
This ticket was mentioned in PR #10134 on WordPress/wordpress-develop by @mukesh27.
6 weeks ago
#1
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/64072
unregistermethod inWP_Block_Templates_Registryto ensure that the error message returned when trying to unregister a non-registered template includes the template name, making debugging easier.unregister_block_template()returns aWP_Errorcontaining the template name when attempting to unregister a template that is not registered. This test also checks for the correct usage notice.