Make WordPress Core

Opened 5 years ago

Last modified 19 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:


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 (5)

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

5 years ago

#2 @westonruter
5 years 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.

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

19 months ago

#4 @kadamwhite
19 months ago

@westonruter is this still a desired enhancement? We're turning over some long-forgotten bugs in triage today :)

#5 @westonruter
19 months ago

This was needed for the Customize Posts plugin to be able to add filters to override a post field based on what has been modified in the Customizer changeset, but this plugin is not being maintained currently so it is not an active need.

Note: See TracTickets for help on using tickets.