-
Notifications
You must be signed in to change notification settings - Fork 8
Maybe find a better name for /site/
?
#14
Comments
I started off agreeing with you, but as I typed this up started to change my opinion a bit. 😄 Here are the endpoints that I think we have to consider:
My first reaction is that it should look something like this:
This means an extra endpoint exists on single site installs that may not be so useful, but it's consistent and explicit. This would also account for the impact of converting a single site to multisite and working with existing URLs. I don't know if Though, when retrieving this data for a site via the central site, it may result in something like I'm not sure if I've cleared my thoughts up by typing that out, but there you go. |
What about |
Hmm, I like how that looks. This could become |
@jeremyfelt Do we need to have this endpoint available as a "sub endpoint" of |
I guess |
Cool, I think we should go with |
I'm a bit confused by the name
/site/
for that endpoint, since when we talk about sites in WordPress, we usually mean sites of a network (multisite). This will especially become confusing once we get multisite-specific endpoints in (/sites/<id>/
and/networks/<id>/
).A first alternative idea would be
/site-options/
or/site-settings/
. However I already got a response on Slack that/site-options/
wouldn't be perfect either since there is a database table of that name that denotes network options (yeah, we don't use the site-options terminology there, but still not optimal).An alternative to finding a new name could be to provide parity with what a specific
/sites/<id>/
response could look like later and include the options as an addition.For example:
Let's say we have a multisite where http://example.com is the main site and there is another site called http://subsite.example.com with site ID 2. When we access
http://example.com/wp-json/wp/v2/sites/2
, we would get basic data for that site, similar with what aWP_Site
object currently contains. To then access more specific details on that site, we would need to callhttp://subsite.example.com/wp-json/wp/v2/site/
. However the latter should also include everything that the MS endpoint includes (like ID, domain, path and network ID), but then additionally include all the settings for the site.I'm not completely convinced of either solution, but I think we should think about this.
The text was updated successfully, but these errors were encountered: