Make WordPress Core

Opened 7 years ago

Last modified 2 years ago

#38702 new enhancement

REST API: Add accessor functions for post_status and post_parent

Reported by: rmccue's profile rmccue 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.


7 years ago

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


4 years ago

#4 @kadamwhite
4 years ago

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

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

#6 @johnbillion
2 years ago

  • Keywords 4.8-early removed
Note: See TracTickets for help on using tickets.