[wp-trac] [WordPress Trac] #43502: `WP_REST_Posts_Controller::prepare_item_for_response()` doesn't reset postdata after calling setup_postdata()
WordPress Trac
noreply at wordpress.org
Tue Apr 7 05:31:49 UTC 2026
#43502: `WP_REST_Posts_Controller::prepare_item_for_response()` doesn't reset
postdata after calling setup_postdata()
-------------------------------------------------+-------------------------
Reporter: gerbenvandijk | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future
| Release
Component: REST API | Version: 4.9.4
Severity: normal | Resolution:
Keywords: good-first-bug has-patch has-unit- | Focuses: rest-api
tests |
-------------------------------------------------+-------------------------
Comment (by liaison):
I've refreshed the patch and opened PR #11455.
Tests conducted:
* Verified all 238 CI checks passed (PHP 7.2 - 8.4).
* Included 2 new unit tests specifically for global $post restoration (one
for existing post, one for null).
* Confirmed fix for 'pollution' during internal REST API calls.
[[Image(ticket-43502.png, 600px)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43502#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list