Opened 9 years ago
Closed 8 years ago
#35647 closed defect (bug) (fixed)
API index should include home URL
Reported by: | iseulde | Owned by: | rmccue |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | REST API | Keywords: | has-patch |
Focuses: | Cc: |
Description
Attachments (2)
Change History (16)
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
9 years ago
- Keywords reporter-feedback added
Replying to iseulde:
Currently it is
get_option( 'siteurl' )
.
@iseulde where are you seeing this? get_rest_url
uses get_home_url()
to determine where the index and endpoints should be located.
#3
in reply to:
↑ 2
@
9 years ago
Replying to rachelbaker:
@iseulde where are you seeing this?
This is in the API index.
The use of siteurl
is intentional, as it's intended to allow discovering the admin &c, but we should probably have a home
value as well.
#4
@
9 years ago
- Milestone changed from Awaiting Review to Future Release
- Summary changed from URL at index should be the home URL? to API index should include home URL
- Type changed from defect (bug) to enhancement
#5
follow-up:
↓ 7
@
8 years ago
- Owner set to rmccue
- Status changed from new to assigned
@rmccue I don't think we should be exposing the site_url
without authentication at all. That isn't public info.
In 35647.diff I changed the index to use home_url()
#6
@
8 years ago
- Keywords has-patch added; reporter-feedback removed
- Milestone changed from Future Release to 4.5
- Type changed from enhancement to defect (bug)
- Version set to 4.4
#7
in reply to:
↑ 5
@
8 years ago
Replying to rachelbaker:
That isn't public info.
I disagree; it's available through links to XML-RPC (<link rel="pingback />
, <link rel="EditURI" />
, <link rel="wlwmanifest" />
), any bundled scripts (<script src="wp-includes/js/..." />
), plus wp-content URLs if it hasn't been moved. There are ways to remove it, but you can also remove it from the index via filters.
(Also, changing it now would be a BC break.)
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
8 years ago
#10
@
8 years ago
@rmccue Okay, so site_url
is not blatantly obvious, but discoverable.
By using the generic url
key, our only option here for adding the home_url
would be to add another key to the index. Suggestions for the new key name? Just home_url
?
This ticket was mentioned in Slack in #core by mike. View the logs.
8 years ago
#12
@
8 years ago
- Version changed from 4.4 to trunk
To me it's kinda "wierd" that the "url" is siteurl. We mostly put WP in a subdirectory so that the /wp-json/ url key would be "domain.com/wp/" - a link that would just result in a 404.
But I guess that the name can't be changed now due to backwards compatibility.
Currently it is
get_option( 'siteurl' )
.