Opened 7 years ago
Last modified 5 years ago
#41459 new task (blessed)
Introduce a REST API endpoint for networks / network options
Reported by: | flixos90 | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | ms-roadmap has-patch has-unit-tests |
Focuses: | multisite | Cc: |
Description
Similar to sites in #40365, there should be a networks endpoint as part of the REST API.
Through recent multisite discussions, we have come to the conclusion that, while multi-network should never be part of core, there should be basic and unopinionated APIs present that can be used by whoever wants to implement it.
A basic networks API in these terms implies that it's a simple CRUD API for the wp_site
database table. #29411 will introduce the internal core functions that this endpoint will be able to use.
The endpoint should be able to do the following:
- List networks:
GET wp/v2/networks/
- Retrieve a network:
GET wp/v2/networks/<id>
- Create a network:
POST wp/v2/networks/
- Update a network:
PUT wp/v2/networks/<id>
- Delete a network:
DELETE wp/v2/networks/<id>
Once the changes in #25344 is in place, a network meta endpoint should be created as well. For now this will be part of this ticket too.
Note that this ticket is an early one and will lay around for a while. The other non-network-related roadmap items have a higher priority.
Attachments (2)
Change History (11)
#2
@
7 years ago
- Keywords needs-patch needs-unit-tests added
- Summary changed from Introduce a REST API endpoint for networks to Introduce a REST API endpoint for networks / network options
#3
@
7 years ago
- Keywords has-patch added; needs-patch removed
Added first patch. This first patch is very simple, just introducing the endpoint without that ability to edit / delete / create networks, this is because these functions do not exist in core.
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
7 years ago
This ticket was mentioned in PR #210 on WordPress/wordpress-develop by sorenbronsted.
5 years ago
#8
I have added the patch from the ticket and written a testunit for it.
If #37181 is put in core, we can also make this endpoint an interface for network options, using the meta api.
If we use the meta api, we can also use the register_meta function to display some fields in the network endpoint. A quick review shows the following fields as possibly useful in the network endpoint.
A number of other fields that might be useful are