[wp-trac] [WordPress Trac] #11698: have_posts should not auto rewind

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 3 00:09:56 UTC 2010


#11698: have_posts should not auto rewind
--------------------------+-------------------------------------------------
 Reporter:  mwillberg     |       Owner:                          
     Type:  defect (bug)  |      Status:  new                     
 Priority:  normal        |   Milestone:  Future Release          
Component:  General       |     Version:  2.9                     
 Severity:  minor         |    Keywords:  dev-feedback 2nd-opinion
--------------------------+-------------------------------------------------
Changes (by dd32):

  * keywords:  => dev-feedback 2nd-opinion
  * version:  => 2.9
  * milestone:  Unassigned => Future Release


Comment:

 > {{{
 while (have_posts()) {the_post();the_title();}
 while (have_posts()) {the_post();the_title();}
 }}}

 Another way to look at that, Is that that itself, is wanting for the loop
 to be repeated.

 > Naturally the "loop_end" hook needs some kind of flag to make sure it
 runs only once and subsequent calls to not activate it.

 IMHO, The while block is the loop, So the loop_end hook should be fired
 afterwards no matter what, you're ending '''a'''' loop.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11698#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list