[wp-trac] [WordPress Trac] #28092: Ability to filter or remove error codes from WP_Error class
WordPress Trac
noreply at wordpress.org
Thu Sep 11 15:39:18 UTC 2014
#28092: Ability to filter or remove error codes from WP_Error class
-----------------------------+-----------------------
Reporter: AdamCapriola | Owner:
Type: feature request | Status: reopened
Priority: normal | Milestone:
Component: General | Version: 2.1
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+-----------------------
Changes (by radiok):
* status: closed => reopened
* resolution: worksforme =>
* component: Login and Registration => General
Comment:
As of r28524, $errors is now private (#22234), r28521 added a setter to
the WP_Error class (#27881) but the overall code to "unset" an error is
now more cumbersome than ever.
{{{#!php
unset( $errors->errors['empty_username'] );
}}}
Is now...
{{{#!php
$temp = $errors->errors;
unset( $temp['empty_username'] );
$errors->errors = $temp;
}}}
All this would be simplified if we could just have a remove function
within WP_Error.
Could this topic be revisited by a developer?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28092#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list