WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 3 weeks ago

#40365 new task (blessed)

Introduce a REST API endpoint for sites

Reported by: jeremyfelt Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: REST API Keywords: needs-patch dev-feedback needs-unit-tests ms-roadmap
Focuses: multisite, rest-api Cc:

Description

It should be possible to manage sites in a multisite configuration through the REST API.

  • List sites: GET wp/v2/sites/
  • Retrieve a site: GET wp/v2/sites/<id>
  • Create a site: POST wp/v2/sites/
  • Update a site: PUT wp/v2/sites/<id>
  • Delete a site: DELETE wp/v2/sites/<id>

Data included in a site object should at least mirror the data available for the site in wp_blogs. Additional ideal pieces of data for a site include blogname, blogdescription, home, and siteurl. It's possible that creating a new meta table for sites can help developers register meta for inclusion with a site object (See #37923).

Sites should be accessible by default for authenticated users only. Network (global) admins should have access to all sites. Site users should have access to the sites they are members of. The "My Sites" list is a great candidate for exploring how this will work. See #15317.

As of the introduction of get_sites() in 4.6.0, retrieving sites is a much better experience. The methods used to create, update, and delete sites in multisite are not as pleasant right now. We should investigate each of these and determine what can be done to streamline the process. The first improvement is probably in creating a site. See #40364.

Change History (9)

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-restapi by flixos90. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-restapi by jnylen. View the logs.


5 weeks ago

#6 @flixos90
5 weeks ago

  • Keywords ms-roadmap added

These tickets belong to our planned roadmap (a few of them not per final decision), so flagging with a keyword for better overview.

#7 @flixos90
5 weeks ago

  • Component changed from Networks and Sites to REST API
  • Keywords changed from needs-patch, dev-feedback, needs-unit-tests, ms-roadmap to needs-patch dev-feedback needs-unit-tests ms-roadmap

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


3 weeks ago

#9 @flixos90
3 weeks ago

For reference: Once #37923 and #38025 are finished, an additional part of this ticket will also be to implement a site meta endpoint.

Note: See TracTickets for help on using tickets.