[wp-trac] [WordPress Trac] #37389: Incorrect WP_Error usage in WP_Tax_Query
WordPress Trac
noreply at wordpress.org
Sun Jul 17 16:31:51 UTC 2016
#37389: Incorrect WP_Error usage in WP_Tax_Query
----------------------------+-----------------
Reporter: SergeyBiryukov | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.6
Component: Taxonomy | Version: 3.2
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------
In `WP_Tax_Query::clean_query()` and `WP_Tax_Query::transform_query()`,
strings are used as error codes:
{{{
$query = new WP_Error( 'Invalid taxonomy' );
...
$query = new WP_Error( 'Inexistent terms' );
}}}
Correct usage would be:
{{{
$query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
...
$query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );
}}}
Introduced in [17686].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37389>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list