Taxonomy: Correct WP_Error usage in WP_Tax_Query::clean_query() and WP_Tax_Query::transform_query().

Fixes #37389.
Built from https://develop.svn.wordpress.org/trunk@38079


git-svn-id: http://core.svn.wordpress.org/trunk@38020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-07-17 16:33:30 +00:00
parent 3fb7d586da
commit d851a2cded
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-beta3-38078';
$wp_version = '4.6-beta3-38079';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.