Skip to content

Commit

Permalink
Add check for css file before trying to read (#12291)
Browse files Browse the repository at this point in the history
* Add check for css file before trying to read

Mirrors existing trac ticket https://core.trac.wordpress.org/ticket/45288

Fixes #12196

* Use other patch :-)
  • Loading branch information
mkaz authored and youknowriad committed Nov 26, 2018
1 parent 4a9de65 commit 1ee2013
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/client-assets.php
Expand Up @@ -1224,11 +1224,13 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'css' => file_get_contents( $style ),
);
} else {
$file = get_theme_file_path( $style );
$styles[] = array(
'css' => file_get_contents( get_theme_file_path( $style ) ),
'baseURL' => get_theme_file_uri( $style ),
);
$file = get_theme_file_path( $style );
if ( file_exists( $file ) ) {
$styles[] = array(
'css' => file_get_contents( $file ),
'baseURL' => get_theme_file_uri( $style ),
);
}
}
}
}
Expand Down

0 comments on commit 1ee2013

Please sign in to comment.