diff --git a/lib/blocks.php b/lib/blocks.php index f4f5a6536cee2..4012e9784ca16 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -164,29 +164,27 @@ function gutenberg_register_core_block_styles( $block_name ) { $block_name = str_replace( 'core/', '', $block_name ); - $style_path = is_rtl() - ? "build/block-library/blocks/$block_name/style-rtl.css" - : "build/block-library/blocks/$block_name/style.css"; - $editor_style_path = is_rtl() - ? "build/block-library/blocks/$block_name/style-editor-rtl.css" - : "build/block-library/blocks/$block_name/style-editor.css"; + $style_path = "build/block-library/blocks/$block_name/style.css"; + $editor_style_path = "build/block-library/blocks/$block_name/style-editor.css"; if ( file_exists( gutenberg_dir_path() . $style_path ) ) { wp_register_style( - 'wp-block-' . $block_name, + "wp-block-{$block_name}", gutenberg_url( $style_path ), array(), filemtime( gutenberg_dir_path() . $style_path ) ); + wp_style_add_data( "wp-block-{$block_name}", 'rtl', 'replace' ); } if ( file_exists( gutenberg_dir_path() . $editor_style_path ) ) { wp_register_style( - 'wp-block-' . $block_name . '-editor', + "wp-block-{$block_name}-editor", gutenberg_url( $editor_style_path ), array(), filemtime( gutenberg_dir_path() . $editor_style_path ) ); + wp_style_add_data( "wp-block-{$block_name}-editor", 'rtl', 'replace' ); } }