Changeset 25139
- Timestamp:
- 08/27/2013 04:38:32 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r25126 r25139 196 196 */ 197 197 var $meta_query = false; 198 199 /** 200 * Date query container 201 * 202 * @since 3.7.0 203 * @access public 204 * @var object WP_Date_Query 205 */ 206 var $date_query = false; 198 207 199 208 /** … … 232 241 'meta_value' => '', 233 242 'meta_query' => '', 243 'date_query' => null, // See WP_Date_Query 234 244 ); 235 245 … … 361 371 } 362 372 373 if ( ! empty( $date_query ) && is_array( $date_query ) ) { 374 $date_query_object = new WP_Date_Query( $date_query, 'comment_date' ); 375 $where .= $date_query_object->get_sql(); 376 } 377 363 378 $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' ); 364 379 $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) ); -
trunk/src/wp-includes/query.php
r25138 r25139 866 866 */ 867 867 var $meta_query = false; 868 869 /** 870 * Date query container 871 * 872 * @since 3.7.0 873 * @access public 874 * @var object WP_Date_Query 875 */ 876 var $date_query = false; 868 877 869 878 /** … … 2046 2055 $where .= " AND $wpdb->posts.menu_order = " . $q['menu_order']; 2047 2056 2048 // If a month is specified in the querystring, load that month2057 // The "m" parameter is meant for months but accepts datetimes of varying specificity 2049 2058 if ( $q['m'] ) { 2050 2059 $where .= " AND YEAR($wpdb->posts.post_date)=" . substr($q['m'], 0, 4); … … 2061 2070 } 2062 2071 2072 // Handle the other individual date parameters 2073 $date_parameters = array(); 2074 2063 2075 if ( '' !== $q['hour'] ) 2064 $ where .= " AND HOUR($wpdb->posts.post_date)='" . $q['hour'] . "'";2076 $date_parameters['hour'] = $q['hour']; 2065 2077 2066 2078 if ( '' !== $q['minute'] ) 2067 $ where .= " AND MINUTE($wpdb->posts.post_date)='" . $q['minute'] . "'";2079 $date_parameters['minute'] = $q['minute']; 2068 2080 2069 2081 if ( '' !== $q['second'] ) 2070 $ where .= " AND SECOND($wpdb->posts.post_date)='" . $q['second'] . "'";2082 $date_parameters['second'] = $q['second']; 2071 2083 2072 2084 if ( $q['year'] ) 2073 $ where .= " AND YEAR($wpdb->posts.post_date)='" . $q['year'] . "'";2085 $date_parameters['year'] = $q['year']; 2074 2086 2075 2087 if ( $q['monthnum'] ) 2076 $where .= " AND MONTH($wpdb->posts.post_date)='" . $q['monthnum'] . "'"; 2088 $date_parameters['monthnum'] = $q['monthnum']; 2089 2090 if ( $q['w'] ) 2091 $date_parameters['week'] = $q['w']; 2077 2092 2078 2093 if ( $q['day'] ) 2079 $where .= " AND DAYOFMONTH($wpdb->posts.post_date)='" . $q['day'] . "'"; 2094 $date_parameters['day'] = $q['day']; 2095 2096 if ( $date_parameters ) { 2097 $date_query = new WP_Date_Query( array( $date_parameters ) ); 2098 $where .= $date_query->get_sql(); 2099 } 2100 unset( $date_parameters, $date_query ); 2101 2102 // Handle complex date queries 2103 if ( ! empty( $q['date_query'] ) ) { 2104 $this->date_query = new WP_Date_Query( $q['date_query'] ); 2105 $where .= $this->date_query->get_sql(); 2106 } 2107 2080 2108 2081 2109 // If we've got a post_type AND it's not "any" post_type. … … 2147 2175 } 2148 2176 2149 if ( $q['w'] )2150 $where .= ' AND ' . _wp_mysql_week( "`$wpdb->posts`.`post_date`" ) . " = '" . $q['w'] . "'";2151 2177 2152 2178 if ( intval($q['comments_popup']) ) -
trunk/src/wp-settings.php
r25001 r25139 108 108 require( ABSPATH . WPINC . '/capabilities.php' ); 109 109 require( ABSPATH . WPINC . '/query.php' ); 110 require( ABSPATH . WPINC . '/date.php' ); 110 111 require( ABSPATH . WPINC . '/theme.php' ); 111 112 require( ABSPATH . WPINC . '/class-wp-theme.php' );
Note: See TracChangeset
for help on using the changeset viewer.