Block Editor: Synchronize global styles endpoint code with Gutenberg.
This adds a missing fallback to ensure styles property is always defined in the returned data. Props gziolo. See #55505. Built from https://develop.svn.wordpress.org/trunk@53075 git-svn-id: http://core.svn.wordpress.org/trunk@52664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
74079f27a9
commit
85837cfa5b
|
@ -582,9 +582,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller {
|
|||
|
||||
if ( rest_is_field_included( 'styles', $fields ) ) {
|
||||
$raw_data = $theme->get_raw_data();
|
||||
if ( isset( $raw_data['styles'] ) ) {
|
||||
$data['styles'] = $raw_data['styles'];
|
||||
}
|
||||
$data['styles'] = isset( $raw_data['styles'] ) ? $raw_data['styles'] : array();
|
||||
}
|
||||
|
||||
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-alpha-53074';
|
||||
$wp_version = '6.0-alpha-53075';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue