From bdfe4f53bc2a96516632bfdc087c2cebe9224ba8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 30 Oct 2023 12:54:22 +0000 Subject: [PATCH] Editor: Correctly load RTL stylesheets in `register_core_block_style_handles()`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When setting an RTL language under Settings → General, some RTL stylesheets were not loaded, with LTR stylesheets being loaded instead, meaning that some blocks were not displayed correctly. This commit ensures that all appropriate RTL stylesheets are loaded when selecting an RTL language. Follow-up to [56524]. Props mukesh27, maahrokh, hellofromTonya, joemcgill, huzaifaalmesbah, rajinsharwar, devmuhib, swissspidy. Fixes #59715. Built from https://develop.svn.wordpress.org/trunk@57028 git-svn-id: http://core.svn.wordpress.org/trunk@56539 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks/index.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/blocks/index.php b/wp-includes/blocks/index.php index 6832759e77..40967727da 100644 --- a/wp-includes/blocks/index.php +++ b/wp-includes/blocks/index.php @@ -106,11 +106,11 @@ function register_core_block_style_handles() { $wp_styles->add( $style_handle, $blocks_url . $style_path ); $wp_styles->add_data( $style_handle, 'path', $path ); - $rtl_file = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $path ); + $rtl_file = "{$name}/{$filename}-rtl{$suffix}.css"; if ( is_rtl() && in_array( $rtl_file, $files, true ) ) { $wp_styles->add_data( $style_handle, 'rtl', 'replace' ); $wp_styles->add_data( $style_handle, 'suffix', $suffix ); - $wp_styles->add_data( $style_handle, 'path', $rtl_file ); + $wp_styles->add_data( $style_handle, 'path', str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $path ) ); } }; diff --git a/wp-includes/version.php b/wp-includes/version.php index c93465eb38..edb1860748 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57027'; +$wp_version = '6.5-alpha-57028'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.