Skip to content

Commit 322c75e

Browse files
authored
Merge pull request #372 from wp-cli/copilot/add-loading-for-rtl-css
`scaffold child-theme`: add RTL stylesheet support via `wp_style_add_data()`
2 parents 9d2efaf + 65e0500 commit 322c75e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

features/scaffold.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Feature: WordPress code scaffolding
99
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`
1010
Then the {THEME_DIR}/zombieland/style.css file should exist
1111
And the {THEME_DIR}/zombieland/functions.php file should exist
12+
And the {THEME_DIR}/zombieland/functions.php file should contain:
13+
"""
14+
wp_style_add_data( 'zombieland-style', 'rtl', 'add' );
15+
"""
1216
And STDOUT should be:
1317
"""
1418
Success: Created '{THEME_DIR}/zombieland'.

templates/child_theme_functions.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ function {{prefix_safe}}_parent_theme_enqueue_styles() {
2020
array( '{{parent_theme}}-style' ),
2121
'0.1.0'
2222
);
23+
wp_style_add_data( '{{slug}}-style', 'rtl', 'add' );
2324
}

0 commit comments

Comments
 (0)