Code cleanup in the paging block. Props kawauso. fixes #19773

git-svn-id: http://svn.automattic.com/wordpress/trunk@19724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-01-09 20:08:57 +00:00
parent ed3a628088
commit 8c3ec18a21

View File

@ -2509,18 +2509,16 @@ class WP_Query {
// Paging
if ( empty($q['nopaging']) && !$this->is_singular ) {
$page = absint($q['paged']);
if ( empty($page) )
if ( !$page )
$page = 1;
if ( empty($q['offset']) ) {
$pgstrt = '';
$pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
} else { // we're ignoring $page and using 'offset'
$q['offset'] = absint($q['offset']);
$pgstrt = $q['offset'] . ', ';
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
}
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
}
// Comments feeds