Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
[62952] just fixed the identical This PR applies the same fix to the sibling case: Rebased status: MERGEABLE, full CI green, and has unit tests covering the restore on every return path. CC @westonruter since you just handled the revisions controller. |
9ba75b6 to
7787967
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
488f7f7 to
abff828
Compare
…prepare_item_for_response()`. Previously, this method overwrote `$GLOBALS['post']` and called `setup_postdata()` without restoring the previous state. Anything running after a REST request that re-used the controller (block rendering, the_content filters in subsequent calls, etc.) saw the wrong global post. This commit captures the previous global before mutation and restores it on every return path, including the early HEAD-request return. Adds tests covering: * Restoration when a global post is already set. * Restoration to `null` when no global post was set. * Restoration on the HEAD-method early-return branch. Complements WordPressGH-1165 and WordPressGH-11455. See #43502.
abff828 to
a4ec099
Compare
|
@westonruter Apologies for missing #11455 when opening this - that was an oversight on my part. The reason for the implementation here is that #11455 used a direct
When [62952] landed the clean resolution for I have updated the |
|
Aside: This PR is missing the required AI Disclosure: wordpress-develop/.github/pull_request_template.md Lines 22 to 33 in 3e9e9d9 Please be sure to note the AI harness and model used when generating PRs and comments for GitHub and Trac. |
|
Thank you @westonruter! Added the AI Disclosure section to the PR description. For reference, Antigravity IDE with Gemini 2.5 Pro was used for code analysis, conflict resolution, test suite updates, and patch verification, with all changes manually reviewed and tested locally. |
Trac ticket: https://core.trac.wordpress.org/ticket/43502
prepare_item_for_response()overwrote$GLOBALS['post']and calledsetup_postdata()without restoring the previous state. Anything running after a REST request that re-used the controller (block rendering,the_contentfilters, etc.) saw the wrong global post.This PR captures the previous global before mutation and restores it on every return path, including the early HEAD-request return.
Tests cover:
nullwhen no global post was setComplements GH-1165 and GH-11455.
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity IDE
Model(s): Gemini 2.5 Pro
Used for: Code analysis, conflict resolution, test suite updates, and patch verification. All changes were manually reviewed and tested locally.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.