WordPress.org

Make WordPress Core

Changeset 26525


Ignore:
Timestamp:
12/02/2013 04:25:54 PM (7 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r26090 r26525  
    28022802                $page = 1;
    28032803
    2804             $pgstrt = ($page - 1) * $q['posts_per_page'];
    2805 
    2806             if ( ! empty( $q['offset'] ) ) {
     2804            if ( empty($q['offset']) ) {
     2805                $pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
     2806            } else { // we're ignoring $page and using 'offset'
    28072807                $q['offset'] = absint($q['offset']);
    2808                 $pgstrt += $q['offset'];
    2809             }
    2810             $limits = 'LIMIT ' . $pgstrt . ', ' . $q['posts_per_page'];
     2808                $pgstrt = $q['offset'] . ', ';
     2809            }
     2810            $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
    28112811        }
    28122812
Note: See TracChangeset for help on using the changeset viewer.