Skip to content

Commit dd56e0b

Browse files
authored
Merge pull request #342 from ernilambar/fix/child-theme-scaffolding
2 parents e706981 + 464d91c commit dd56e0b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Scaffold_Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ public function child_theme( $args, $assoc_args ) {
492492
'theme_uri' => '',
493493
];
494494

495-
$data = wp_parse_args( $assoc_args, $defaults );
496-
$data['slug'] = $theme_slug;
497-
$data['parent_theme_function_safe'] = str_replace( [ ' ', '-' ], '_', $data['parent_theme'] );
498-
$data['description'] = ucfirst( $data['parent_theme'] ) . ' child theme.';
495+
$data = wp_parse_args( $assoc_args, $defaults );
496+
$data['slug'] = $theme_slug;
497+
$data['prefix_safe'] = str_replace( [ ' ', '-' ], '_', $theme_slug );
498+
$data['description'] = ucfirst( $data['parent_theme'] ) . ' child theme.';
499499

500500
$theme_dir = WP_CONTENT_DIR . "/themes/{$theme_slug}";
501501

templates/child_theme_functions.mustache

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
* @package {{slug}}
88
*/
99

10-
add_action( 'wp_enqueue_scripts', '{{parent_theme_function_safe}}_parent_theme_enqueue_styles' );
10+
add_action( 'wp_enqueue_scripts', '{{prefix_safe}}_parent_theme_enqueue_styles' );
1111

1212
/**
1313
* Enqueue scripts and styles.
1414
*/
15-
function {{parent_theme_function_safe}}_parent_theme_enqueue_styles() {
16-
wp_enqueue_style( '{{parent_theme}}-style', get_template_directory_uri() . '/style.css' );
17-
wp_enqueue_style( '{{slug}}-style',
15+
function {{prefix_safe}}_parent_theme_enqueue_styles() {
16+
wp_enqueue_style( '{{parent_theme}}-style', get_template_directory_uri() . '/style.css', array(), '0.1.0' );
17+
wp_enqueue_style(
18+
'{{slug}}-style',
1819
get_stylesheet_directory_uri() . '/style.css',
19-
[ '{{parent_theme}}-style' ]
20+
array( '{{parent_theme}}-style' ),
21+
'0.1.0'
2022
);
2123
}

0 commit comments

Comments
 (0)