Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading RTL CSS files on all RTL sites #3096

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix loading RTL CSS files on all RTL sites
There is a problem on all RTL sites using block themes and block CSS files
This fixes loading all RTL CSS files and also add suffix to the styles object

This fixes:
https://wordpress.org/support/topic/rtl-problem-bug/
WordPress/gutenberg#41649
WordPress/gutenberg#41762

CC to locale managers:
@naokomc
@tobifjellner
  • Loading branch information
farhadsakhaei authored Aug 16, 2022
commit a92a1af4846a1a0893f4ca7e877490f999fe1e90
5 changes: 4 additions & 1 deletion src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ function register_block_style_handle( $metadata, $field_name ) {
array(),
$version
);
if ( file_exists( str_replace( '.css', '-rtl.css', $style_file ) ) ) {

wp_style_add_data( $style_handle, 'suffix', $suffix );

if ( file_exists( str_replace( "$suffix.css", "-rtl$suffix.css", $style_file ) ) ) {
wp_style_add_data( $style_handle, 'rtl', 'replace' );
}
if ( $has_style_file ) {
Expand Down