[wp-trac] [WordPress Trac] #25380: Allow posts_per_page option for pre_get_posts action hook on feed

WordPress Trac noreply at wordpress.org
Fri Mar 7 18:32:42 UTC 2014


#25380: Allow posts_per_page option for pre_get_posts action hook on feed
----------------------------------------+-----------------------------
 Reporter:  wokamoto                    |       Owner:  wonderboymusic
     Type:  defect (bug)                |      Status:  closed
 Priority:  normal                      |   Milestone:  3.9
Component:  Query                       |     Version:  3.6.1
 Severity:  normal                      |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------------
Changes (by wonderboymusic):

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"27455"]:
 {{{
 #!CommitTicketReference repository="" revision="27455"
 When setting `posts_per_page` in `WP_Query::get_posts()`, check for
 `is_feed()` in the same place where `posts_per_page` is set when it is not
 already set. Previously, when `is_feed()` was true, `posts_per_page` would
 be arbitrarily overwritten. This fix allows `posts_per_page` to be set
 during `pre_get_posts` when `is_feed()` is true and not be overwritten.

 Adds unit test.

 Props wokamoto.
 Fixes #25380.
 }}}

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


More information about the wp-trac mailing list