Block Editor: Fix PHP warning showing up when loading editor styles while in RTL.

In RTL languages, WordPress adds style-editor-rtl.css editor styles to the global $editor_styles
This patch ignores handling these styles if the file is not preset.

Props desrosj, mostafa.s1990.
Fixes #45288.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43923 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella 2018-11-21 19:29:11 +00:00
parent 4a58b3de2e
commit 47c42639aa

View File

@ -197,11 +197,13 @@ if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
);
}
} 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 ),
);
}
}
}
}