[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
Mon Nov 20 04:03:34 UTC 2023


#18408: Can't wp_reset_postdata after custom WP_Query in an admin edit page
-------------------------------------------------+-------------------------
 Reporter:  ericlewis                            |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.5
Component:  Query                                |     Version:  4.7.2
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing has-patch early        |     Focuses:
  needs-unit-tests                               |
-------------------------------------------------+-------------------------

Comment (by Howdy_McGee):

 The latest patch moves away from a hook-based approach and adds the
 association directly to post.php. This should account for the following
 cases:

  - Direct query overrides with the not-recommended query_posts() and
 wp_reset_query()
  - Secondary queries with WP_Query() and wp_reset_postdata()
  - Global post overrides with setup_postdata( $post ) and
 wp_reset_postdata().

 I agree with @oglekler that this should be moved to Future release until
 Unit Tests can be added.

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


More information about the wp-trac mailing list