44 *
55 * Enqueue CSS/JS of all the blocks.
66 *
7- * @since 1.0.0
7+ * @since 1.0.0
88 * @package CGB
99 */
1010
@@ -26,7 +26,7 @@ function <% blockNamePHPLower %>_cgb_block_assets() {
2626 '<% blockNamePHPLower %>-cgb-style-css ' , // Handle.
2727 plugins_url ( 'dist/blocks.style.build.css ' , dirname ( __FILE__ ) ), // Block style CSS.
2828 array ( 'wp-blocks ' ) // Dependency to include the CSS after it.
29- // filemtime( plugin_dir_path( __FILE__ ) . 'editor .css' ) // Version: filemtime β Gets file modification time.
29+ // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build .css' ) // Version: filemtime β Gets file modification time.
3030 );
3131} // End function <% blockNamePHPLower %>_cgb_block_assets().
3232
@@ -47,18 +47,19 @@ function <% blockNamePHPLower %>_cgb_editor_assets() {
4747 wp_enqueue_script (
4848 '<% blockNamePHPLower %>-cgb-block-js ' , // Handle.
4949 plugins_url ( '/dist/blocks.build.js ' , dirname ( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack.
50- array ( 'wp-blocks ' , 'wp-i18n ' , 'wp-element ' ) // Dependencies, defined above.
51- // filemtime( plugin_dir_path( __FILE__ ) . 'block.js' ) // Version: filemtime β Gets file modification time.
50+ array ( 'wp-blocks ' , 'wp-i18n ' , 'wp-element ' ), // Dependencies, defined above.
51+ // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime β Gets file modification time.
52+ true // Enqueue the script in the footer.
5253 );
5354
5455 // Styles.
5556 wp_enqueue_style (
5657 '<% blockNamePHPLower %>-cgb-block-editor-css ' , // Handle.
5758 plugins_url ( 'dist/blocks.editor.build.css ' , dirname ( __FILE__ ) ), // Block editor CSS.
5859 array ( 'wp-edit-blocks ' ) // Dependency to include the CSS after it.
59- // filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' ) // Version: filemtime β Gets file modification time.
60+ // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks. editor.build .css' ) // Version: filemtime β Gets file modification time.
6061 );
6162} // End function <% blockNamePHPLower %>_cgb_editor_assets().
6263
6364// Hook: Editor assets.
64- add_action ( 'enqueue_block_editor_assets ' , '<% blockNamePHPLower %>_cgb_editor_assets ' );
65+ add_action ( 'enqueue_block_editor_assets ' , '<% blockNamePHPLower %>_cgb_editor_assets ' );
0 commit comments