From ad30724bb5557e740b5244b68eca8bef2e4114e2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 17 Jul 2016 16:32:50 +0000 Subject: [PATCH] Taxonomy: Correct `WP_Error` usage in `WP_Tax_Query::clean_query()` and `WP_Tax_Query::transform_query()`. Fixes #37389. git-svn-id: https://develop.svn.wordpress.org/trunk@38079 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-tax-query.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-wp-tax-query.php b/src/wp-includes/class-wp-tax-query.php index c77538d00a..9bff196f28 100644 --- a/src/wp-includes/class-wp-tax-query.php +++ b/src/wp-includes/class-wp-tax-query.php @@ -562,14 +562,14 @@ class WP_Tax_Query { private function clean_query( &$query ) { if ( empty( $query['taxonomy'] ) ) { if ( 'term_taxonomy_id' !== $query['field'] ) { - $query = new WP_Error( 'Invalid taxonomy' ); + $query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) ); return; } // so long as there are shared terms, include_children requires that a taxonomy is set $query['include_children'] = false; } elseif ( ! taxonomy_exists( $query['taxonomy'] ) ) { - $query = new WP_Error( 'Invalid taxonomy' ); + $query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) ); return; } @@ -655,7 +655,7 @@ class WP_Tax_Query { } if ( 'AND' == $query['operator'] && count( $terms ) < count( $query['terms'] ) ) { - $query = new WP_Error( 'Inexistent terms' ); + $query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) ); return; }