/**
* Array of taxonomy queries.
*
- * See {@see WP_Tax_Query::__construct()} for information on tax query arguments.
+ * See WP_Tax_Query::__construct() for information on tax query arguments.
*
* @since 3.1.0
* @access public
// Store the alias with this clause, so later siblings can use it.
$clause['alias'] = $alias;
- $join .= " INNER JOIN $wpdb->term_relationships";
+ $join .= " LEFT JOIN $wpdb->term_relationships";
$join .= $i ? " AS $alias" : '';
$join .= " ON ($this->primary_table.$this->primary_id_column = $alias.object_id)";
}
* @since 3.2.0
* @access private
*
- * @param array &$query The single query.
+ * @param array $query The single query. Passed by reference.
*/
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;
}
*
* @global wpdb $wpdb The WordPress database abstraction object.
*
- * @param array &$query The single query.
+ * @param array $query The single query. Passed by reference.
* @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id',
* or 'term_id'. Default 'term_id'.
*/
}
if ( 'AND' == $query['operator'] && count( $terms ) < count( $query['terms'] ) ) {
- $query = new WP_Error( 'Inexistent terms' );
+ $query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );
return;
}