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:
parent
96c2ae4409
commit
dc3bccda20
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user