Opened 11 years ago
Closed 10 years ago
#35647 closed defect (bug) (fixed)
API index should include home URL
| Reported by: | iseulde | Owned by: | rmccue |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | REST API | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Attachments (2)
Change History (16)
#2
in reply to: ↑ 1
;
follow-up:
↓ 3
@
11 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
@
11 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
@
11 years ago
- Milestone Awaiting Review → Future Release
- Summary URL at index should be the home URL? → API index should include home URL
- Type defect (bug) → enhancement
#5
follow-up:
↓ 7
@
10 years ago
- Owner set to
- Status new → 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
@
10 years ago
- Keywords has-patch added; reporter-feedback removed
- Milestone Future Release → 4.5
- Type enhancement → defect (bug)
- Version → 4.4
#7
in reply to: ↑ 5
@
10 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.
10 years ago
#10
@
10 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.
10 years ago
#12
@
10 years ago
- Version 4.4 → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Currently it is
get_option( 'siteurl' ).