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

git-svn-id: https://develop.svn.wordpress.org/trunk@19724 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-01-09 20:08:57 +00:00
parent 96c2ae4409
commit dc3bccda20
1 changed files with 2 additions and 4 deletions

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