mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
WP_Query
should not ignore an offset of 0
.
Props mazurstas. Fixes #34060. Built from https://develop.svn.wordpress.org/trunk@34697 git-svn-id: http://core.svn.wordpress.org/trunk@34661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5b32e27a00
commit
c36d4fb8a9
@ -3123,11 +3123,12 @@ class WP_Query {
|
||||
if ( !$page )
|
||||
$page = 1;
|
||||
|
||||
if ( empty($q['offset']) ) {
|
||||
$pgstrt = absint( ( $page - 1 ) * $q['posts_per_page'] ) . ', ';
|
||||
} else { // we're ignoring $page and using 'offset'
|
||||
$q['offset'] = absint($q['offset']);
|
||||
// If 'offset' is provided, it takes precedence over 'paged'.
|
||||
if ( isset( $q['offset'] ) && is_numeric( $q['offset'] ) ) {
|
||||
$q['offset'] = absint( $q['offset'] );
|
||||
$pgstrt = $q['offset'] . ', ';
|
||||
} else {
|
||||
$pgstrt = absint( ( $page - 1 ) * $q['posts_per_page'] ) . ', ';
|
||||
}
|
||||
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34696';
|
||||
$wp_version = '4.4-alpha-34697';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user