Make WordPress Core

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.

Attachments (3)

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

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
7 years ago

  • Component General → REST API

@dkarfa
7 years ago

#2 @dkarfa
7 years ago

  • Keywords has-patch added

#3 @TimothyBlynJacobs
7 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
7 years ago

@dkarfa
7 years ago

#4 @dkarfa
7 years ago

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

Note: See TracTickets for help on using tickets.