[wp-trac] [WordPress Trac] #34060: WP_Query zero offset parameter doesn't override paged

WordPress Trac noreply at wordpress.org
Tue Oct 27 20:18:25 UTC 2015


#34060: WP_Query zero offset parameter doesn't override paged
--------------------------+---------------------------
 Reporter:  mazurstas     |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.4
Component:  Query         |     Version:  4.3.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------------

Comment (by westonruter):

 @boonebgorges I'm using `get_posts()` without `'suppress_filters' =>
 false`, and this function has an `offset` of `0` among its `$defaults`:

 {{{#!php
 <?php
 function get_posts( $args = null ) {
         $defaults = array(
                 'numberposts' => 5, 'offset' => 0,  // <========= HERE
                 'category' => 0, 'orderby' => 'date',
                 'order' => 'DESC', 'include' => array(),
                 'exclude' => array(), 'meta_key' => '',
                 'meta_value' =>'', 'post_type' => 'post',
                 'suppress_filters' => true
         );
         /* ... */
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34060#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list