Changeset 3678 for trunk/wp-includes/template-functions-links.php
- Timestamp:
- 04/02/2006 12:33:10 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-links.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-links.php
r3647 r3678 471 471 472 472 if ( 'posts' == get_query_var('what_to_show') ) { 473 preg_match('#FROM\s(.*)\s GROUPBY#siU', $wp_query->request, $matches);473 preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches); 474 474 $fromwhere = $matches[1]; 475 475 $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); … … 477 477 } else { 478 478 $posts = $wp_query->posts; 479 preg_match('#WHERE\s(.*)\s GROUPBY#siU', $wp_query->request, $matches);479 preg_match('#WHERE\s(.*)\sORDER BY#siU', $wp_query->request, $matches); 480 480 $where = preg_replace('/( AND )?post_date >= (\'|\")(.*?)(\'|\")( AND post_date <= (\'\")(.*?)(\'\"))?/siU', '', $matches[1]); 481 481 $num_days = $wpdb->query("SELECT DISTINCT post_date FROM $wpdb->posts WHERE $where GROUP BY year(post_date), month(post_date), dayofmonth(post_date)");
Note: See TracChangeset
for help on using the changeset viewer.