Block Editor: Update the packages with a number of fixes targeted for Beta 4.

It includes fixes from these two backport PRs: 

 - https://github.com/WordPress/gutenberg/pull/32992
 - https://github.com/WordPress/gutenberg/pull/32956

Props gziolo, ryelle, ntsekouras, desrosj, jorgefilipecosta.
See #53397


git-svn-id: https://develop.svn.wordpress.org/trunk@51241 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella
2021-06-25 15:50:14 +00:00
parent 69ead0f406
commit a794914408
13 changed files with 168 additions and 108 deletions
@@ -1228,6 +1228,7 @@ class WP_REST_Server {
$response = new WP_REST_Response( $available );
$response->add_link( 'help', 'https://developer.wordpress.org/rest-api/' );
$this->add_active_theme_link_to_index( $response );
$this->add_site_logo_to_index( $response );
/**
* Filters the REST API root index data.
@@ -1272,6 +1273,29 @@ class WP_REST_Server {
}
}
/**
* Exposes the site logo through the WordPress REST API.
* This is used for fetching this information when user has no rights
* to update settings.
*
* @since 5.8.0
*
* @param WP_REST_Response $response REST API response.
*/
protected function add_site_logo_to_index( WP_REST_Response $response ) {
$site_logo_id = get_theme_mod( 'custom_logo' );
$response->data['site_logo'] = $site_logo_id;
if ( $site_logo_id ) {
$response->add_link(
'https://api.w.org/featuredmedia',
rest_url( 'wp/v2/media/' . $site_logo_id ),
array(
'embeddable' => true,
)
);
}
}
/**
* Retrieves the index for a namespace.
*