[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
Sun Dec 9 20:27:45 UTC 2018
#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: Future
| Release
Component: Query | Version: 4.7.2
Severity: normal | Resolution:
Keywords: needs-testing ongoing needs-patch | Focuses:
-----------------------------------------------+---------------------------
Comment (by billerickson):
This issue still exists in WordPress 5.0, with both the Classic Editor and
Block Editor.
You can reproduce the issue with this plugin:
https://gist.github.com/billerickson/21ff280fb26c3b98120044d53f4e1b61
Classic Editor screenshot: https://cl.ly/e122cffed719
Block Editor screenshot: https://cl.ly/33bd55ca2869
This caused issues in Gutenberg blocks as well (see
https://github.com/WordPress/gutenberg/issues/7468 ), and was temporarily
fixed using the same approach outlined above - backup the global $post and
restore it afterwards (see
https://github.com/WordPress/gutenberg/pull/7889 ).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/18408#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list