Opened 4 years ago
Last modified 3 months ago
#54293 new enhancement
Expand functionality of themes REST API
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | REST API | Keywords: | needs-unit-tests has-patch needs-testing |
| Focuses: | rest-api | Cc: |
Description (last modified by )
Current the REST API for themes is extremely limited. It only allows for listing themes and getting the current theme. However, there are lots theme related functions that are not possible to access via this api. This includes ( but it not limited to )
- Installing new themes
- Network activating theme ( multisite only )
- Network deactivating theme ( multisite only )
- Active ( switch to theme )
- Deleting theme
Any themes api should allow the patterns / structure of the plugins REST API, in it's params and responses.
It is also worth noting, that have a multisite element, as themes can be network activated / deactivated.
Change History (6)
This ticket was mentioned in PR #9344 on WordPress/wordpress-develop by @iamadisingh.
4 months ago
#5
- Keywords has-patch added; needs-patch removed
Adds endpoints to install, activate (switch), and delete themes via the REST API.
Implements:
- POST /wp/v2/themes (install)
- PUT /wp/v2/themes/<stylesheet> (activate)
- DELETE /wp/v2/themes/<stylesheet> (delete)
Trac ticket: https://core.trac.wordpress.org/ticket/54293
For some extra context, this ticket was created because of this make blog post.
If the plan is to move to a react / gutenberg component based UI for themes, then then core will need this functionality in the theme REST API.