[wp-trac] [WordPress Trac] #18408: Can't wp_reset_postdata after custom WP_Query in an admin edit page

WordPress Trac noreply at wordpress.org
Thu Mar 26 04:00:22 UTC 2015


#18408: Can't wp_reset_postdata after custom WP_Query in an admin edit page
-------------------------------------------------+-------------------------
 Reporter:  ericlewis                            |       Owner:  ericlewis
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Query                                |  Review
 Severity:  normal                               |     Version:  3.8.1
 Keywords:  has-patch needs-testing 2nd-opinion  |  Resolution:
                                                 |     Focuses:
-------------------------------------------------+-------------------------

Comment (by dezio1900):

 I experienced the same bug when I tried to change the Toolbar items inside
 the "wp_before_admin_bar_render" action hook. I wanted to add one custom
 type posts to the toolbar, and of course I used WP_Query, but that caused
 this bug to occur in posts edit screen.

 I ended up using "get_posts" instead of "WP_Query" and that solved the
 problem. BUT this bug is not acceptable, and it should be fixed!

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


More information about the wp-trac mailing list