Skip to content

Commit

Permalink
set styles only if exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Feb 8, 2022
1 parent 6ab75e1 commit 3c4c4df
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ public function get_theme_item( $request ) {

if ( rest_is_field_included( 'styles', $fields ) ) {
$raw_data = $theme->get_raw_data();
$data['styles'] = isset( $raw_data['styles'] ) ? $raw_data['styles'] : array();
if ( isset( $raw_data['styles'] ) ) {
$data['styles'] = $raw_data['styles'];
}
}

$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
Expand Down

0 comments on commit 3c4c4df

Please sign in to comment.