[wp-trac] [WordPress Trac] #61896: Allow custom errors with correct HTML class for `edit-tag-form.php`
WordPress Trac
noreply at wordpress.org
Mon Aug 19 16:43:21 UTC 2024
#61896: Allow custom errors with correct HTML class for `edit-tag-form.php`
----------------------------+-----------------------------
Reporter: xipasduarte | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
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:
{{{#!php
$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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61896>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list