#42869 closed enhancement (wontfix)
Rest URL home vs. site
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.4 |
| Component: | REST API | Keywords: | |
| Focuses: | Cc: |
Description
We're having the issue that the REST API is only available via the home url, not the site url.
Unlike many other Wordpress users, we only use it as a headless CMS - the page hosted under home url is not a Wordpress, but a custom-built application. It doesn't know anything about the Wordpress API (and it should not!).
I know that this issue was rejected in https://core.trac.wordpress.org/ticket/37020, so I'm asking to either
a) add the possibility to configure the host for the API endoint or
b) give me some information on how to customize the REST API host via a plugin
Thanks in advance!
Change History (4)
Note: See
TracTickets for help on using
tickets.
@dennishh You can use the
rest_urlfilter to customize the returned value of theget_rest_url()function.https://developer.wordpress.org/reference/hooks/rest_url/
https://developer.wordpress.org/reference/functions/get_rest_url/