Skip to content

Commit

Permalink
Block Editor: Synchronize global styles endpoint code with Gutenberg.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
youknowriad committed Apr 5, 2022
1 parent 74079f2 commit 85837cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,7 @@ public function get_theme_item( $request ) {

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';
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 85837cf

Please sign in to comment.