Check REST visibility for content resizing posts#658
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #658 +/- ##
=============================================
+ Coverage 74.57% 74.75% +0.17%
- Complexity 1754 1755 +1
=============================================
Files 85 85
Lines 7548 7553 +5
=============================================
+ Hits 5629 5646 +17
+ Misses 1919 1907 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dkotter
left a comment
There was a problem hiding this comment.
There are a handful of PHPCS and PHPStan errors here that need cleaned up before we merge this
What?
Adds a REST visibility check to the Content Resizing ability permission callback when a post ID is supplied.
Why?
Similar text abilities already prevent execution for posts whose post type is not exposed in REST. Content Resizing checked whether the user could edit the post, but did not apply that post type visibility check, leaving the ability inconsistent with the rest of the plugin.
How?
After confirming the post exists and the current user can edit it, the permission callback now checks the post type and returns
falseif the post type is missing or not exposed in REST.Use of AI Tools
AI assistance: Yes
Tool(s): Codex / ChatGPT
Model(s): GPT-5
Used for: Comparing permission callbacks across similar abilities and drafting the consistency fix. I reviewed the change and PR description before submitting.
Testing Instructions
Screenshots or screencast
Not applicable. This PR does not change the UI.
Changelog Entry