From ba55e433a418cdb7b52fb0294ebd58d6e49e0864 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 2 Dec 2013 16:26:10 +0000 Subject: [PATCH] Revert [26012] for now, which had fixed using `paged` with `offset` in WP_Query but introduced side effects for those working around it. see #18897. Built from https://develop.svn.wordpress.org/trunk@26525 git-svn-id: http://core.svn.wordpress.org/trunk@26418 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 3bc0fcd4f9..1ec9566c41 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2801,13 +2801,13 @@ class WP_Query { if ( !$page ) $page = 1; - $pgstrt = ($page - 1) * $q['posts_per_page']; - - if ( ! empty( $q['offset'] ) ) { + if ( empty($q['offset']) ) { + $pgstrt = ($page - 1) * $q['posts_per_page'] . ', '; + } else { // we're ignoring $page and using '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