mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
REST API: Add the missing site_icon_url to the index.
The `site_icon_url` index was supposed to ship with WordPress 5.6, but was [https://github.com/WordPress/gutenberg/pull/22952 never backported to core]. This commit backports the original PR from Gutenberg repository: * [https://github.com/WordPress/gutenberg/pull/42957 #42957: REST API: Add the missing 'site_icon_url' to the index] Follow-up to [52080]. Props Mamaduka, bernhard-reiter, TimothyBlynJacobs. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1308,6 +1308,8 @@ class WP_REST_Server {
|
||||
$site_icon_id = get_option( 'site_icon', 0 );
|
||||
|
||||
$this->add_image_to_index( $response, $site_icon_id, 'site_icon' );
|
||||
|
||||
$response->data['site_icon_url'] = get_site_icon_url();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1084,6 +1084,7 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
|
||||
// Check site logo and icon.
|
||||
$this->assertArrayHasKey( 'site_logo', $data );
|
||||
$this->assertArrayHasKey( 'site_icon', $data );
|
||||
$this->assertArrayHasKey( 'site_icon_url', $data );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10781,7 +10781,8 @@ mockedApiResponse.Schema = {
|
||||
}
|
||||
},
|
||||
"site_logo": 0,
|
||||
"site_icon": 0
|
||||
"site_icon": 0,
|
||||
"site_icon_url": ""
|
||||
};
|
||||
|
||||
mockedApiResponse.oembed = {
|
||||
|
||||
Reference in New Issue
Block a user