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:
parent
ed3a628088
commit
8c3ec18a21
|
@ -2509,18 +2509,16 @@ class WP_Query {
|
||||||
// Paging
|
// Paging
|
||||||
if ( empty($q['nopaging']) && !$this->is_singular ) {
|
if ( empty($q['nopaging']) && !$this->is_singular ) {
|
||||||
$page = absint($q['paged']);
|
$page = absint($q['paged']);
|
||||||
if ( empty($page) )
|
if ( !$page )
|
||||||
$page = 1;
|
$page = 1;
|
||||||
|
|
||||||
if ( empty($q['offset']) ) {
|
if ( empty($q['offset']) ) {
|
||||||
$pgstrt = '';
|
|
||||||
$pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
|
$pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
|
||||||
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
|
|
||||||
} else { // we're ignoring $page and using 'offset'
|
} else { // we're ignoring $page and using 'offset'
|
||||||
$q['offset'] = absint($q['offset']);
|
$q['offset'] = absint($q['offset']);
|
||||||
$pgstrt = $q['offset'] . ', ';
|
$pgstrt = $q['offset'] . ', ';
|
||||||
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
|
|
||||||
}
|
}
|
||||||
|
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comments feeds
|
// Comments feeds
|
||||||
|
|
Loading…
Reference in New Issue