Opened 9 years ago
Last modified 4 years ago
#38702 new enhancement
REST API: Add accessor functions for post_status and post_parent
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | REST API | Keywords: | has-patch needs-unit-tests |
| Focuses: | Cc: |
Description
In order to enable better permission checks for Customiser Changesets, these need to be filterable.
See xwp/wp-customize-snapshots#32. Split from #38701.
Change History (6)
This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.
9 years ago
This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.
6 years ago
#4
@
6 years ago
@westonruter is this still a desired enhancement? We're turning over some long-forgotten bugs in triage today :)
Note: See
TracTickets for help on using
tickets.
The first thing to do is to replace any current usages of
$post->post_statuswith simplyget_post_status( $post->ID ).See https://github.com/xwp/wordpress-develop/pull/214
The lesser-important change to core is to handle permission checks for a post/page that has an
inheritstatus when thepost_parentitself is modified in the customized state. In this case, there needs to be filters applied on thepost_parentvalue itself. However, there is noget_post_parent()function with any filters currently in core.