Make WordPress Core

Opened 6 months ago

Last modified 8 weeks ago

#52321 new enhancement

Add site icon to rest index

Reported by: spacedmonkey Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords: good-first-bug has-patch has-unit-tests
Focuses: Cc:


Add site icon to list of site metadata return in the index.

Attachments (1)

52321.diff (668 bytes) - added by palmiak 4 months ago.

Download all attachments as: .zip

Change History (11)

#1 @TimothyBlynJacobs
6 months ago

  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Version set to 4.4

Should we expose the id of the attachment and then link to it? Or output get_site_icon_url. If the latter, what sizes should we expose?

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.

6 months ago

#3 @palmiak
4 months ago

@spacedmonkey you mean the /wp-json/ url right? Together with name, description etc.

Personally I would use the default size provided by get_site_icon_url - it's filtrable so it wouldn't be a problem if someone would like to change it.

4 months ago

#4 @spacedmonkey
4 months ago

  • Keywords has-patch needs-unit-tests added; needs-patch removed

Thanks for the patch @palmiak.

Looking at the patch, it seems like we should add some basic unit tests. Maybe a case with and without a site icon set to see what happens. The tests should be added here.

#5 @lephleg
4 months ago

Hello @palmiak, is there a PR for this in order to add the unit tests?

This ticket was mentioned in PR #1111 on WordPress/wordpress-develop by palmiak.

4 months ago

  • Keywords has-unit-tests added; needs-unit-tests removed

#7 @palmiak
4 months ago

I added a test to check if key exists and one more, after setting the image, is the image name correct.

#8 @spacedmonkey
8 weeks ago

@TimothyBlynJacobs I feel like we can get this into WP 5.8. It is a simple change.

#9 @TimothyBlynJacobs
8 weeks ago

Feature freeze for 5.8 has already passed. Feel free to milestone for 5.9 though.

#10 @spacedmonkey
8 weeks ago

  • Milestone changed from Future Release to 5.9
Note: See TracTickets for help on using tickets.