Correct relation var and PHP4 constructor. See #15752
git-svn-id: http://svn.automattic.com/wordpress/trunk@16850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e5690e7ebe
commit
6f9d098c9b
|
@ -535,7 +535,7 @@ class WP_Tax_Query {
|
||||||
var $relation = '';
|
var $relation = '';
|
||||||
var $queries = array();
|
var $queries = array();
|
||||||
|
|
||||||
function __construct( &$tax_query ) {
|
function WP_Tax_Query( &$tax_query ) {
|
||||||
if ( isset( $tax_query['relation'] ) && strtoupper( $tax_query['relation'] ) == 'OR' ) {
|
if ( isset( $tax_query['relation'] ) && strtoupper( $tax_query['relation'] ) == 'OR' ) {
|
||||||
$this->relation = 'OR';
|
$this->relation = 'OR';
|
||||||
} else {
|
} else {
|
||||||
|
@ -599,7 +599,7 @@ class WP_Tax_Query {
|
||||||
if ( 'IN' == $operator ) {
|
if ( 'IN' == $operator ) {
|
||||||
|
|
||||||
if ( empty( $terms ) ) {
|
if ( empty( $terms ) ) {
|
||||||
if ( 'OR' == $relation )
|
if ( 'OR' == $this->relation )
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
return array( 'join' => '', 'where' => ' AND 0 = 1' );
|
return array( 'join' => '', 'where' => ' AND 0 = 1' );
|
||||||
|
@ -633,7 +633,7 @@ class WP_Tax_Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !empty( $where ) )
|
if ( !empty( $where ) )
|
||||||
$where = ' AND ( ' . implode( " $relation ", $where ) . ' )';
|
$where = ' AND ( ' . implode( " $this->relation ", $where ) . ' )';
|
||||||
else
|
else
|
||||||
$where = '';
|
$where = '';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue