From bf50226d08a56e97319855eb2907f0275a2e897e Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Mon, 30 Nov 2026 12:22:36 +0100 Subject: [PATCH 1/3] Align left-justified layouts to the start edge in RTL Core writes a constrained layout's "left" justification as physical margins, so in RTL the content stays on the left. - Sidebar templates: the main column's justification follows is_rtl(). - Archive and search patterns: the excerpt and read more group is a Stack, whose alignment follows the text direction. Fixes #261. Co-Authored-By: Claude Fable 5.2 --- patterns/archive-compact.php | 2 +- patterns/archive-lead.php | 2 +- patterns/archive-standard.php | 2 +- patterns/hidden-archive-sidebar.php | 2 +- patterns/hidden-index-sidebar.php | 2 +- patterns/hidden-page-sidebar.php | 2 +- patterns/hidden-search.php | 2 +- patterns/hidden-single-sidebar.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/patterns/archive-compact.php b/patterns/archive-compact.php index 00df682..950404f 100644 --- a/patterns/archive-compact.php +++ b/patterns/archive-compact.php @@ -29,7 +29,7 @@ - +
diff --git a/patterns/archive-lead.php b/patterns/archive-lead.php index 9a1bfdf..80e55f8 100644 --- a/patterns/archive-lead.php +++ b/patterns/archive-lead.php @@ -36,7 +36,7 @@ - +
diff --git a/patterns/archive-standard.php b/patterns/archive-standard.php index f193437..06b3046 100644 --- a/patterns/archive-standard.php +++ b/patterns/archive-standard.php @@ -33,7 +33,7 @@ - +
diff --git a/patterns/hidden-archive-sidebar.php b/patterns/hidden-archive-sidebar.php index e6bea2a..992cbf0 100644 --- a/patterns/hidden-archive-sidebar.php +++ b/patterns/hidden-archive-sidebar.php @@ -15,7 +15,7 @@
-
+
diff --git a/patterns/hidden-index-sidebar.php b/patterns/hidden-index-sidebar.php index 816a151..03c304c 100644 --- a/patterns/hidden-index-sidebar.php +++ b/patterns/hidden-index-sidebar.php @@ -19,7 +19,7 @@ -
+
diff --git a/patterns/hidden-page-sidebar.php b/patterns/hidden-page-sidebar.php index c389cb9..f7d1d09 100644 --- a/patterns/hidden-page-sidebar.php +++ b/patterns/hidden-page-sidebar.php @@ -15,7 +15,7 @@
-
+
diff --git a/patterns/hidden-search.php b/patterns/hidden-search.php index 9ec757a..92d15ee 100644 --- a/patterns/hidden-search.php +++ b/patterns/hidden-search.php @@ -37,7 +37,7 @@
- +
diff --git a/patterns/hidden-single-sidebar.php b/patterns/hidden-single-sidebar.php index e19b72b..2b491a8 100644 --- a/patterns/hidden-single-sidebar.php +++ b/patterns/hidden-single-sidebar.php @@ -15,7 +15,7 @@
-
+
From ef3e20a7d80682f6fe4db605c56961d94eb9f7ad Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Mon, 30 Nov 2026 16:30:18 +0100 Subject: [PATCH 2/3] Follow the site language, not the user's, for the sidebar column In the editors is_rtl() follows the current user's language, so an editor whose profile reads the other way would save the wrong side into the template. Co-Authored-By: Claude Fable 5.2 --- functions.php | 24 ++++++++++++++++++++++++ patterns/hidden-archive-sidebar.php | 2 +- patterns/hidden-index-sidebar.php | 2 +- patterns/hidden-page-sidebar.php | 2 +- patterns/hidden-single-sidebar.php | 2 +- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 0df9a37..5592561 100644 --- a/functions.php +++ b/functions.php @@ -344,5 +344,29 @@ function ipsum_register_block_styles() { endif; add_action( 'init', 'ipsum_register_block_styles' ); +// Tells the sidebar patterns which way the site reads, whoever is looking at them. +if ( ! function_exists( 'ipsum_is_site_rtl' ) ) : + /** + * Checks whether the site language is written right to left. + * + * In the editors, is_rtl() follows the language of the current user. A pattern + * that used it there would save that user's direction into the template. + * + * @since Ipsum 1.0 + * + * @return bool Whether the site language is written right to left. + */ + function ipsum_is_site_rtl() { + $switched = switch_to_locale( get_locale() ); + $is_rtl = is_rtl(); + + if ( $switched ) { + restore_previous_locale(); + } + + return $is_rtl; + } +endif; + // Registers the design guide ability for agents. require get_parent_theme_file_path( 'inc/abilities.php' ); diff --git a/patterns/hidden-archive-sidebar.php b/patterns/hidden-archive-sidebar.php index 992cbf0..62243ab 100644 --- a/patterns/hidden-archive-sidebar.php +++ b/patterns/hidden-archive-sidebar.php @@ -15,7 +15,7 @@
-
+
diff --git a/patterns/hidden-index-sidebar.php b/patterns/hidden-index-sidebar.php index 03c304c..6f9db98 100644 --- a/patterns/hidden-index-sidebar.php +++ b/patterns/hidden-index-sidebar.php @@ -19,7 +19,7 @@ -
+
diff --git a/patterns/hidden-page-sidebar.php b/patterns/hidden-page-sidebar.php index f7d1d09..11c74f1 100644 --- a/patterns/hidden-page-sidebar.php +++ b/patterns/hidden-page-sidebar.php @@ -15,7 +15,7 @@
-
+
diff --git a/patterns/hidden-single-sidebar.php b/patterns/hidden-single-sidebar.php index 2b491a8..f20f3bf 100644 --- a/patterns/hidden-single-sidebar.php +++ b/patterns/hidden-single-sidebar.php @@ -15,7 +15,7 @@
-
+
From 8675a3c6a75bbd58351c6637bb5e75fdb04af324 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Mon, 30 Nov 2026 16:33:40 +0100 Subject: [PATCH 3/3] Revert "Follow the site language, not the user's, for the sidebar column" This reverts commit ef3e20a7d80682f6fe4db605c56961d94eb9f7ad. --- functions.php | 24 ------------------------ patterns/hidden-archive-sidebar.php | 2 +- patterns/hidden-index-sidebar.php | 2 +- patterns/hidden-page-sidebar.php | 2 +- patterns/hidden-single-sidebar.php | 2 +- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/functions.php b/functions.php index 5592561..0df9a37 100644 --- a/functions.php +++ b/functions.php @@ -344,29 +344,5 @@ function ipsum_register_block_styles() { endif; add_action( 'init', 'ipsum_register_block_styles' ); -// Tells the sidebar patterns which way the site reads, whoever is looking at them. -if ( ! function_exists( 'ipsum_is_site_rtl' ) ) : - /** - * Checks whether the site language is written right to left. - * - * In the editors, is_rtl() follows the language of the current user. A pattern - * that used it there would save that user's direction into the template. - * - * @since Ipsum 1.0 - * - * @return bool Whether the site language is written right to left. - */ - function ipsum_is_site_rtl() { - $switched = switch_to_locale( get_locale() ); - $is_rtl = is_rtl(); - - if ( $switched ) { - restore_previous_locale(); - } - - return $is_rtl; - } -endif; - // Registers the design guide ability for agents. require get_parent_theme_file_path( 'inc/abilities.php' ); diff --git a/patterns/hidden-archive-sidebar.php b/patterns/hidden-archive-sidebar.php index 62243ab..992cbf0 100644 --- a/patterns/hidden-archive-sidebar.php +++ b/patterns/hidden-archive-sidebar.php @@ -15,7 +15,7 @@
-
+
diff --git a/patterns/hidden-index-sidebar.php b/patterns/hidden-index-sidebar.php index 6f9db98..03c304c 100644 --- a/patterns/hidden-index-sidebar.php +++ b/patterns/hidden-index-sidebar.php @@ -19,7 +19,7 @@ -
+
diff --git a/patterns/hidden-page-sidebar.php b/patterns/hidden-page-sidebar.php index 11c74f1..f7d1d09 100644 --- a/patterns/hidden-page-sidebar.php +++ b/patterns/hidden-page-sidebar.php @@ -15,7 +15,7 @@
-
+
diff --git a/patterns/hidden-single-sidebar.php b/patterns/hidden-single-sidebar.php index f20f3bf..2b491a8 100644 --- a/patterns/hidden-single-sidebar.php +++ b/patterns/hidden-single-sidebar.php @@ -15,7 +15,7 @@
-
+