[wp-trac] [WordPress Trac] #63761: Adding Edit/PUT Method for Template REST API Endpoint.
WordPress Trac
noreply at wordpress.org
Mon Jul 28 00:26:29 UTC 2025
#63761: Adding Edit/PUT Method for Template REST API Endpoint.
-------------------------+-----------------------------
Reporter: SirLouen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Keywords: 2nd-opinion
Focuses: |
-------------------------+-----------------------------
Following along with [https://github.com/WordPress/gutenberg/issues/51886
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
[https://github.com/WordPress/gutenberg/issues/51886#issuecomment-3124828349
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63761>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list