File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function {{machine_name}}_block_init() {
1818 return;
1919 }
2020 { {#plugin} }
21- $dir = dirname( __FILE__ ) ;
21+ $dir = __DIR__ ;
2222 { {/plugin} }
2323 { {#theme} }
2424 $dir = get_stylesheet_directory() . '/blocks';
@@ -38,7 +38,8 @@ function {{machine_name}}_block_init() {
3838 'wp-i18n',
3939 'wp-element',
4040 ],
41- filemtime( "{ $dir } /{ $index_js } " )
41+ filemtime( "{ $dir } /{ $index_js } " ),
42+ false
4243 );
4344
4445 $editor_css = '{ {slug} }/editor.css';
@@ -67,11 +68,14 @@ function {{machine_name}}_block_init() {
6768 filemtime( "{ $dir } /{ $style_css } " )
6869 );
6970
70- register_block_type( '{ {namespace} }/{ {slug} }', [
71- 'editor_script' => '{ {slug} }-block-editor',
72- 'editor_style' => '{ {slug} }-block-editor',
73- 'style' => '{ {slug} }-block',
74- ] );
71+ register_block_type(
72+ '{ {namespace} }/{ {slug} }',
73+ [
74+ 'editor_script' => '{ {slug} }-block-editor',
75+ 'editor_style' => '{ {slug} }-block-editor',
76+ 'style' => '{ {slug} }-block',
77+ ]
78+ );
7579}
7680
7781add_action( 'init', '{ {machine_name} }_block_init' );
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ require_once "{$_tests_dir}/includes/functions.php";
2929 * Manually load the plugin being tested.
3030 */
3131function _manually_load_plugin() {
32- require dirname( dirname( __FILE__ ) ) . ' /{{plugin_main_file}}' ;
32+ require dirname( __DIR__ ) . ' /{{plugin_main_file}}' ;
3333}
3434
3535tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
You can’t perform that action at this time.
0 commit comments