Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#48816 new enhancement

Use get_bloginfo in the REST API index

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords: 2nd-opinion has-patch
Focuses: Cc:

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.

Attachments (3)

48816.patch (825 bytes) - added by dkarfa 5 years ago.
48816.1.patch (870 bytes) - added by dkarfa 5 years ago.
48816.2.patch (753 bytes) - added by dkarfa 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to REST API

@dkarfa
5 years ago

#2 @dkarfa
5 years ago

  • Keywords has-patch added

#3 @TimothyBlynJacobs
5 years ago

Thanks for the patch @dkarfa! To clarify, I didn't make this super clear, I meant using get_bloginfo() with the $filter parameter set to display so the filters are applied. I'm not 100% sure its a good idea yet :)

@dkarfa
5 years ago

@dkarfa
5 years ago

#4 @dkarfa
5 years ago

Hi, @TimothyBlynJacobs,
I have updated the patch.
Thank you

Note: See TracTickets for help on using tickets.