From 3ab0f22ec6767d8b554b25914d321a4ef840d669 Mon Sep 17 00:00:00 2001 From: youknowriad Date: Wed, 21 Nov 2018 19:30:48 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/5.0@43923 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43755 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-blocks.php | 12 +++++++----- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php index 74ec34c9f2..c81f40e5fd 100644 --- a/wp-admin/edit-form-blocks.php +++ b/wp-admin/edit-form-blocks.php @@ -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 ), + ); + } } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0712cba814..3c6ce0884c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-beta5-43922'; +$wp_version = '5.0-beta5-43923'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.