#61896 closed defect (bug) (fixed)
Allow custom errors with correct HTML class for `edit-tag-form.php`
| Reported by: | xipasduarte | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.7 |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | administration |
Description
The term_updated_messages filter allows for messages to be customized (add, remove or change), but in the case of errors there is an issue if we want other messages to be considered as an error. On the edit-tag-form.php the class is related only to the value of the message code, only $msg == 5 is considered an error.
Looking at where this message is set, I could only find on reference on edit-tags.php, line 191, with the following code:
$location = add_query_arg( array( 'error' => true, 'message' => 5, ), $referer );
The #_REQUEST['error'] argument appears to be set, as expected, and the wrong class seems to be due to a leftover from the past. So the fix is actually pretty simple, we could just use the request argument to define the class.
Attachments (1)
Change History (6)
This ticket was mentioned in PR #7212 on WordPress/wordpress-develop by @xipasduarte.
2 years ago
#1
- Keywords has-patch added
Base the edit-tag-form.php notice class on the $_REQUEST['error'] argument.
Trac ticket: core.trac.wordpress.org/ticket/61896
@SergeyBiryukov commented on PR #7212:
2 years ago
#5
Thanks for the PR! Merged in r58918.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Base class logic on
$_REQUEST['error']