Opened 7 years ago
Last modified 7 years ago
#48816 new enhancement
Use get_bloginfo in the REST API index
| Reported by: | TimothyBlynJacobs | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | REST API | Version: | 4.4 |
| Severity: | normal | Keywords: | 2nd-opinion has-patch |
| Cc: | Focuses: |
Description
The REST API provides data in the site "index" when making a request to https://example.org/wp-json. This describes the site and the APIs available. In particular it returns the name of the website, and the tagline. These values are retrieved using get_option directly instead of get_bloginfo.
Because this data would be used presentationally, it seems like it'd be more useful if it returned the "presentation" version of these strings.
As far as I could tell, the index has more or less worked the same since the GSOC version of the REST API, so I wasn't able to find any description of why it was built that way.
I opened this because of a Gutenberg PR which would display the site title.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the patch @dkarfa! To clarify, I didn't make this super clear, I meant using
get_bloginfo()with the$filterparameter set todisplayso the filters are applied. I'm not 100% sure its a good idea yet :)