mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-03 19:41:39 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53075 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user