Skip to content
Permalink
Browse files

Block Editor: Fix PHP warning showing up when loading editor styles w…

…hile 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
  • Loading branch information...
youknowriad committed Nov 21, 2018
1 parent 4a58b3d commit 47c42639aacac439ca6f1442dbee990ae4c2097e
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/wp-admin/edit-form-blocks.php
@@ -197,11 +197,13 @@
);
}
} 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 ),
);
}
}
}
}

0 comments on commit 47c4263

Please sign in to comment.
You can’t perform that action at this time.