[wp-trac] [WordPress Trac] #58147: bugfix: rewind_posts when posts array index != 0

WordPress Trac noreply at wordpress.org
Mon Apr 17 20:39:53 UTC 2023


#58147: bugfix: rewind_posts when posts array index != 0
--------------------------+------------------------------
 Reporter:  diogovf       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  6.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by petitphp):

 Hi, welcome to the trac, and thanks for the ticket and the associated PR.

 As far as I can tell, the `rewind_posts` method hasn't changed since it
 was introduced in WP 1.5. Can you share more info on how you end up with a
 posts array that doesn't start at index `0` for your query ?

 As noted by @Presskopp WordPress is still supporting PHP 5.6, you could
 use [https://www.php.net/manual/en/function.reset.php reset] to achieve
 the same result while keeping this compatibility.

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


More information about the wp-trac mailing list