From ec6320a3696fc26ebff0f673ca8a50d8830bb67c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 08:27:55 +0000 Subject: [PATCH 1/5] Initial plan From c3e3dc46ebf980866a5bcedf16cf1b4c3b79551a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 08:30:38 +0000 Subject: [PATCH 2/5] Add wp_style_add_data() for RTL support in scaffold child-theme Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/scaffold.feature | 8 ++++++++ templates/child_theme_functions.mustache | 2 ++ 2 files changed, 10 insertions(+) diff --git a/features/scaffold.feature b/features/scaffold.feature index a492036f..5e70f0b6 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -9,6 +9,14 @@ Feature: WordPress code scaffolding When I run `wp scaffold child-theme zombieland --parent_theme=umbrella --theme_name=Zombieland --author=Tallahassee --author_uri=https://wp-cli.org --theme_uri=http://www.zombieland.com` Then the {THEME_DIR}/zombieland/style.css file should exist And the {THEME_DIR}/zombieland/functions.php file should exist + And the {THEME_DIR}/zombieland/functions.php file should contain: + """ + wp_style_add_data( 'umbrella-style', 'rtl', 'replace' ); + """ + And the {THEME_DIR}/zombieland/functions.php file should contain: + """ + wp_style_add_data( 'zombieland-style', 'rtl', 'replace' ); + """ And STDOUT should be: """ Success: Created '{THEME_DIR}/zombieland'. diff --git a/templates/child_theme_functions.mustache b/templates/child_theme_functions.mustache index 0879a00d..3077829d 100644 --- a/templates/child_theme_functions.mustache +++ b/templates/child_theme_functions.mustache @@ -14,10 +14,12 @@ add_action( 'wp_enqueue_scripts', '{{prefix_safe}}_parent_theme_enqueue_styles' */ function {{prefix_safe}}_parent_theme_enqueue_styles() { wp_enqueue_style( '{{parent_theme}}-style', get_template_directory_uri() . '/style.css', array(), '0.1.0' ); + wp_style_add_data( '{{parent_theme}}-style', 'rtl', 'replace' ); wp_enqueue_style( '{{slug}}-style', get_stylesheet_directory_uri() . '/style.css', array( '{{parent_theme}}-style' ), '0.1.0' ); + wp_style_add_data( '{{slug}}-style', 'rtl', 'replace' ); } From 4ac617fd0b7e4295de1e9ec81393249d97239462 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 08:40:42 +0000 Subject: [PATCH 3/5] Remove wp_style_add_data() for parent theme; keep only child theme RTL Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/scaffold.feature | 4 ---- templates/child_theme_functions.mustache | 1 - 2 files changed, 5 deletions(-) diff --git a/features/scaffold.feature b/features/scaffold.feature index 5e70f0b6..1191bf20 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -9,10 +9,6 @@ Feature: WordPress code scaffolding When I run `wp scaffold child-theme zombieland --parent_theme=umbrella --theme_name=Zombieland --author=Tallahassee --author_uri=https://wp-cli.org --theme_uri=http://www.zombieland.com` Then the {THEME_DIR}/zombieland/style.css file should exist And the {THEME_DIR}/zombieland/functions.php file should exist - And the {THEME_DIR}/zombieland/functions.php file should contain: - """ - wp_style_add_data( 'umbrella-style', 'rtl', 'replace' ); - """ And the {THEME_DIR}/zombieland/functions.php file should contain: """ wp_style_add_data( 'zombieland-style', 'rtl', 'replace' ); diff --git a/templates/child_theme_functions.mustache b/templates/child_theme_functions.mustache index 3077829d..a16139e5 100644 --- a/templates/child_theme_functions.mustache +++ b/templates/child_theme_functions.mustache @@ -14,7 +14,6 @@ add_action( 'wp_enqueue_scripts', '{{prefix_safe}}_parent_theme_enqueue_styles' */ function {{prefix_safe}}_parent_theme_enqueue_styles() { wp_enqueue_style( '{{parent_theme}}-style', get_template_directory_uri() . '/style.css', array(), '0.1.0' ); - wp_style_add_data( '{{parent_theme}}-style', 'rtl', 'replace' ); wp_enqueue_style( '{{slug}}-style', get_stylesheet_directory_uri() . '/style.css', From 8a429c298e0de694e1779cd8475f5382f7d613a4 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 4 Mar 2026 10:56:10 +0100 Subject: [PATCH 4/5] Update templates/child_theme_functions.mustache Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- templates/child_theme_functions.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/child_theme_functions.mustache b/templates/child_theme_functions.mustache index a16139e5..34ba77a6 100644 --- a/templates/child_theme_functions.mustache +++ b/templates/child_theme_functions.mustache @@ -20,5 +20,5 @@ function {{prefix_safe}}_parent_theme_enqueue_styles() { array( '{{parent_theme}}-style' ), '0.1.0' ); - wp_style_add_data( '{{slug}}-style', 'rtl', 'replace' ); + wp_style_add_data( '{{slug}}-style', 'rtl', 'add' ); } From 65e050058b656aeb9400fe276ee2cad2ea8e9cda Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 4 Mar 2026 10:56:33 +0100 Subject: [PATCH 5/5] Apply suggestion from @swissspidy --- features/scaffold.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/scaffold.feature b/features/scaffold.feature index 1191bf20..0f50a61e 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -11,7 +11,7 @@ Feature: WordPress code scaffolding And the {THEME_DIR}/zombieland/functions.php file should exist And the {THEME_DIR}/zombieland/functions.php file should contain: """ - wp_style_add_data( 'zombieland-style', 'rtl', 'replace' ); + wp_style_add_data( 'zombieland-style', 'rtl', 'add' ); """ And STDOUT should be: """