mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Editor: Correctly load RTL stylesheets in register_core_block_style_handles().
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. git-svn-id: https://develop.svn.wordpress.org/trunk@57028 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user