mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 19:24:34 +00:00
In WP_Date_Query::get_sql_for_subquery(), don't parse duplicate parameters - only parse one of w and week or month and monthnum.
Adds unit tests. Props oso96_2000, ChriCo. Fixes #25835. git-svn-id: https://develop.svn.wordpress.org/trunk@28252 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -256,16 +256,12 @@ class WP_Date_Query {
|
||||
|
||||
if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) )
|
||||
$where_parts[] = "MONTH( $column ) $compare $value";
|
||||
|
||||
// Legacy
|
||||
if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )
|
||||
else if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )
|
||||
$where_parts[] = "MONTH( $column ) $compare $value";
|
||||
|
||||
if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) )
|
||||
$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
|
||||
|
||||
// Legacy
|
||||
if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )
|
||||
else if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )
|
||||
$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
|
||||
|
||||
if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )
|
||||
|
||||
Reference in New Issue
Block a user