Get rid of redundant ->tax_query. See #12891

git-svn-id: https://develop.svn.wordpress.org/trunk@15765 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-10-09 10:19:15 +00:00
parent eb59a85d22
commit c4a14ee8d9
3 changed files with 33 additions and 35 deletions
+13 -24
View File
@@ -563,27 +563,6 @@ class WP_Object_Query {
*/
var $meta_query = array();
/*
* List of taxonomy queries
*
* A query is an associative array:
* - 'taxonomy' string|array The taxonomy being queried
* - 'terms' string|array The list of terms
* - 'field' string (optional) Which term field is being used.
* Possible values: 'term_id', 'slug' or 'name'
* Default: 'slug'
* - 'operator' string (optional)
* Possible values: 'IN' and 'NOT IN'.
* Default: 'IN'
* - 'include_children' bool (optional) Whether to include child terms.
* Default: true
*
* @since 3.1.0
* @access public
* @var array
*/
var $tax_query = array();
/*
* Populates the $meta_query property
*
@@ -694,16 +673,26 @@ class WP_Object_Query {
* @access protected
* @since 3.1.0
*
* @uses $this->tax_query
* @param array $tax_query List of taxonomy queries. A single taxonomy query is an associative array:
* - 'taxonomy' string|array The taxonomy being queried
* - 'terms' string|array The list of terms
* - 'field' string (optional) Which term field is being used.
* Possible values: 'term_id', 'slug' or 'name'
* Default: 'slug'
* - 'operator' string (optional)
* Possible values: 'IN' and 'NOT IN'.
* Default: 'IN'
* - 'include_children' bool (optional) Whether to include child terms.
* Default: true
*
* @param string $object_id_column
* @return string
*/
function get_tax_sql( $object_id_column ) {
function get_tax_sql( $tax_query, $object_id_column ) {
global $wpdb;
$sql = array();
foreach ( $this->tax_query as $query ) {
foreach ( $tax_query as $query ) {
if ( !isset( $query['include_children'] ) )
$query['include_children'] = true;