1616/**
1717 * Enqueue Gutenberg block assets for both frontend + backend.
1818 *
19- * `wp-editor`: WP editor styles.
20- *
19+ * @uses {wp-editor} for WP editor styles.
2120 * @since 1.0.0
2221 */
23- function <% blockNamePHPLower %>_cgb_block_assets () {
22+ function <% blockNamePHPLower %>_cgb_block_assets () { // phpcs:ignore
2423 // Styles.
2524 wp_enqueue_style (
2625 '<% blockNamePHPLower %>-cgb-style-css ' , // Handle.
2726 plugins_url ( 'dist/blocks.style.build.css ' , dirname ( __FILE__ ) ), // Block style CSS.
2827 array ( 'wp-editor ' ) // Dependency to include the CSS after it.
29- // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime β Gets file modification time.
28+ // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time.
3029 );
31- } // End function <% blockNamePHPLower %>_cgb_block_assets().
30+ }
3231
3332// Hook: Frontend assets.
3433add_action ( 'enqueue_block_assets ' , '<% blockNamePHPLower %>_cgb_block_assets ' );
3534
3635/**
3736 * Enqueue Gutenberg block assets for backend editor.
3837 *
39- * `wp-blocks`: includes block type registration and related functions.
40- * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks.
41- * `wp-i18n`: internationalize the block's text.
42- * `wp-editor`: WP editor styles.
43- *
38+ * @uses {wp-blocks} for block type registration & related functions.
39+ * @uses {wp-element} for WP Element abstraction β structure of blocks.
40+ * @uses {wp-i18n} to internationalize the block's text.
41+ * @uses {wp-editor} for WP editor styles.
4442 * @since 1.0.0
4543 */
46- function <% blockNamePHPLower %>_cgb_editor_assets () {
44+ function <% blockNamePHPLower %>_cgb_editor_assets () { // phpcs:ignore
4745 // Scripts.
4846 wp_enqueue_script (
4947 '<% blockNamePHPLower %>-cgb-block-js ' , // Handle.
5048 plugins_url ( '/dist/blocks.build.js ' , dirname ( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack.
5149 array ( 'wp-blocks ' , 'wp-i18n ' , 'wp-element ' , 'wp-editor ' ), // Dependencies, defined above.
52- // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime β Gets file modification time.
50+ // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: File modification time.
5351 true // Enqueue the script in the footer.
5452 );
5553
@@ -58,9 +56,9 @@ function <% blockNamePHPLower %>_cgb_editor_assets() {
5856 '<% blockNamePHPLower %>-cgb-block-editor-css ' , // Handle.
5957 plugins_url ( 'dist/blocks.editor.build.css ' , dirname ( __FILE__ ) ), // Block editor CSS.
6058 array ( 'wp-edit-blocks ' ) // Dependency to include the CSS after it.
61- // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime β Gets file modification time.
59+ // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time.
6260 );
63- } // End function <% blockNamePHPLower %>_cgb_editor_assets().
61+ }
6462
6563// Hook: Editor assets.
6664add_action ( 'enqueue_block_editor_assets ' , '<% blockNamePHPLower %>_cgb_editor_assets ' );
0 commit comments