Opened 4 months ago
Last modified 9 days ago
#63761 new enhancement
Adding Edit/PUT Method for Template REST API Endpoint.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | REST API | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Following along with GB 51886
There is a problem in the API that hinders the possibility of a more precise permission selection for Templates in the Editor:
The template endpoint does not provide the PUT method. The PUT is paired with the update method, which happens to be what canUser needs to enable this allowance for Template editing via Editor.
As explained in the Gutenberg answer without a single Method for EDITABLE this doesn't seem to be doable.
The only solution I can see here is adding an attribute to the WP_REST_Server class, that laser targets exclusively the PUT. Maybe something like PUT_EDITABLE.
I think that for completeness purposes, all methods should have had an attribute (yes, we can add the methods manually without using the attributes, but it looks more elegant with them).
Maybe someone can throw a second opinion on this.
Change History (3)
This ticket was mentioned in PR #9331 on WordPress/wordpress-develop by @SirLouen.
4 months ago
#1
- Keywords has-patch added
#2
@
9 days ago
- Keywords 2nd-opinion removed
- Milestone changed from Awaiting Review to 7.0
After a couple of months, I've re-reviewed this, and it seems it's ready to move forward the Gutenberg ticket.
Expecting a final review.
Maybe if what I was explaining in the OP was not clear, this is an example to showcase what I mean.
Here there is not much to test. The testing part must be done in the Gutenberg Post I mentioned above (using the patch)
Trac ticket: https://core.trac.wordpress.org/ticket/63761