#61896 closed defect (bug) (fixed)
Allow custom errors with correct HTML class for `edit-tag-form.php`
Reported by: | xipasduarte | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | administration | Cc: |
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.
4 weeks 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
#3
@
3 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 58918:
@SergeyBiryukov commented on PR #7212:
3 weeks ago
#5
Thanks for the PR! Merged in r58918.
Base class logic on
$_REQUEST['error']