WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 7 weeks ago

#48816 new enhancement

Use get_bloginfo in the REST API index

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

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 8 weeks ago.
48816.1.patch (870 bytes) - added by dkarfa 7 weeks ago.
48816.2.patch (753 bytes) - added by dkarfa 7 weeks ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
8 weeks ago

  • Component changed from General to REST API

@dkarfa
8 weeks ago

#2 @dkarfa
8 weeks ago

  • Keywords has-patch added

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

@dkarfa
7 weeks ago

#4 @dkarfa
7 weeks ago

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

Note: See TracTickets for help on using tickets.