Ticket #2558: query_posts_offset_support.diff
| File query_posts_offset_support.diff, 2.0 kB (added by markjaquith, 2 years ago) |
|---|
-
wp-includes/query.php
old new 874 874 } 875 875 876 876 if (($q['what_to_show'] == 'posts')) { 877 $pgstrt = ''; 878 $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', '; 879 $limits = 'LIMIT '.$pgstrt.$q['posts_per_page']; 877 if ( empty($q['offset']) ) { 878 $pgstrt = ''; 879 $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', '; 880 $limits = 'LIMIT '.$pgstrt.$q['posts_per_page']; 881 } else { // we're ignoring $page and using 'offset' 882 $pgstrt = intval($q['offset']) . ', '; 883 $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; 884 } 880 885 } elseif ($q['what_to_show'] == 'days') { 881 886 $startrow = $q['posts_per_page'] * (intval($page)-1); 882 887 $start_date = $wpdb->get_var("SELECT max(post_date) FROM $wpdb->posts $join WHERE (1=1) $where GROUP BY year(post_date), month(post_date), dayofmonth(post_date) ORDER BY post_date DESC LIMIT $startrow,1"); -
wp-includes/classes.php
old new 75 75 class WP { 76 76 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots'); 77 77 78 var $private_query_vars = array(' posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type');78 var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type'); 79 79 var $extra_query_vars = array(); 80 80 81 81 var $query_vars;
