Skip to content

Commit e437db9

Browse files
authored
Scaffold block support for child theme.
1 parent fe73e6f commit e437db9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/block-php.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function {{machine_name}}_block_init() {
2121
$dir = dirname( __FILE__ );
2222
{{/plugin}}
2323
{{#theme}}
24-
$dir = get_template_directory() . '/blocks';
24+
$dir = get_stylesheet_directory() . '/blocks';
2525
{{/theme}}
2626

2727
$index_js = '{{slug}}/index.js';
@@ -31,7 +31,7 @@ function {{machine_name}}_block_init() {
3131
plugins_url( $index_js, __FILE__ ),
3232
{{/plugin}}
3333
{{#theme}}
34-
get_template_directory_uri() . "/blocks/$index_js",
34+
get_stylesheet_directory_uri() . "/blocks/$index_js",
3535
{{/theme}}
3636
array(
3737
'wp-blocks',
@@ -48,7 +48,7 @@ function {{machine_name}}_block_init() {
4848
plugins_url( $editor_css, __FILE__ ),
4949
{{/plugin}}
5050
{{#theme}}
51-
get_template_directory_uri() . "/blocks/$editor_css",
51+
get_stylesheet_directory_uri() . "/blocks/$editor_css",
5252
{{/theme}}
5353
array(),
5454
filemtime( "$dir/$editor_css" )
@@ -61,7 +61,7 @@ function {{machine_name}}_block_init() {
6161
plugins_url( $style_css, __FILE__ ),
6262
{{/plugin}}
6363
{{#theme}}
64-
get_template_directory_uri() . "/blocks/$style_css",
64+
get_stylesheet_directory_uri() . "/blocks/$style_css",
6565
{{/theme}}
6666
array(),
6767
filemtime( "$dir/$style_css" )

0 commit comments

Comments
 (0)