Opened 13 months ago
Closed 12 months ago
#64072 closed defect (bug) (fixed)
Improve error message in `WP_Block_Templates_Registry::unregister()` to include template name
| Reported by: | mukesh27 | Owned by: | mukesh27 |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.9 |
| Component: | Editor | Version: | 6.7 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | template |
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.
13 months ago
#1
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.