WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 10 months ago

#38702 new enhancement

REST API: Add accessor functions for post_status and post_parent

Reported by: rmccue Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: 4.8-early 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 (2)

This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.


10 months ago

#2 @westonruter
10 months ago

  • Keywords has-patch needs-unit-tests added

The first thing to do is to replace any current usages of $post->post_status with simply get_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 inherit status when the post_parent itself is modified in the customized state. In this case, there needs to be filters applied on the post_parent value itself. However, there is no get_post_parent() function with any filters currently in core.

Note: See TracTickets for help on using tickets.