Skip to content

Commit d7f4e14

Browse files
authored
Merge pull request #242 from zzap/patch-1
2 parents 8c545c5 + a6e29c2 commit d7f4e14

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

features/scaffold-block.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ Feature: WordPress block code scaffolding
173173
"""
174174
And the {PLUGIN_DIR}/blocks/plugin-block.php file should not contain:
175175
"""
176-
get_template_directory
176+
get_stylesheet_directory
177177
"""
178178
And the {THEME_DIR}/blocks/theme-block.php file should contain:
179179
"""
180-
get_template_directory
180+
get_stylesheet_directory
181181
"""
182182
And the {THEME_DIR}/blocks/theme-block.php file should not contain:
183183
"""

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)