diff --git a/examples/01-single-block/src/init.php b/examples/01-single-block/src/init.php index 545debcf..d0e9188c 100644 --- a/examples/01-single-block/src/init.php +++ b/examples/01-single-block/src/init.php @@ -4,7 +4,7 @@ * * Enqueue CSS/JS of all the blocks. * - * @since 1.0.0 + * @since 1.0.0 * @package CGB */ @@ -16,8 +16,7 @@ /** * Enqueue Gutenberg block assets for both frontend + backend. * - * `wp-editor`: WP editor styles. - * + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function single_block_cgb_block_assets() { @@ -26,9 +25,9 @@ function single_block_cgb_block_assets() { 'single_block-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. array( 'wp-editor' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. ); -} // End function single_block_cgb_block_assets(). +} // Hook: Frontend assets. add_action( 'enqueue_block_assets', 'single_block_cgb_block_assets' ); @@ -36,11 +35,10 @@ function single_block_cgb_block_assets() { /** * Enqueue Gutenberg block assets for backend editor. * - * `wp-blocks`: includes block type registration and related functions. - * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. - * `wp-i18n`: internationalize the block's text. - * `wp-editor`: WP editor styles. - * + * @uses {wp-blocks} for block type registration & related functions. + * @uses {wp-element} for WP Element abstraction — structure of blocks. + * @uses {wp-i18n} to internationalize the block's text. + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function single_block_cgb_editor_assets() { @@ -49,7 +47,7 @@ function single_block_cgb_editor_assets() { 'single_block-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ) // Dependencies, defined above. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: File modification time. ); // Styles. @@ -57,9 +55,9 @@ function single_block_cgb_editor_assets() { 'single_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); -} // End function single_block_cgb_editor_assets(). +} // Hook: Editor assets. -add_action( 'enqueue_block_editor_assets', 'single_block_cgb_editor_assets' ); \ No newline at end of file +add_action( 'enqueue_block_editor_assets', 'single_block_cgb_editor_assets' ); diff --git a/examples/02-single-block-ejected/src/init.php b/examples/02-single-block-ejected/src/init.php index 545debcf..c56d3a6e 100644 --- a/examples/02-single-block-ejected/src/init.php +++ b/examples/02-single-block-ejected/src/init.php @@ -4,7 +4,7 @@ * * Enqueue CSS/JS of all the blocks. * - * @since 1.0.0 + * @since 1.0.0 * @package CGB */ @@ -16,8 +16,7 @@ /** * Enqueue Gutenberg block assets for both frontend + backend. * - * `wp-editor`: WP editor styles. - * + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function single_block_cgb_block_assets() { @@ -26,7 +25,7 @@ function single_block_cgb_block_assets() { 'single_block-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. array( 'wp-editor' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. ); } // End function single_block_cgb_block_assets(). @@ -36,11 +35,10 @@ function single_block_cgb_block_assets() { /** * Enqueue Gutenberg block assets for backend editor. * - * `wp-blocks`: includes block type registration and related functions. - * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. - * `wp-i18n`: internationalize the block's text. - * `wp-editor`: WP editor styles. - * + * @uses {wp-blocks} for block type registration & related functions. + * @uses {wp-element} for WP Element abstraction — structure of blocks. + * @uses {wp-i18n} to internationalize the block's text. + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function single_block_cgb_editor_assets() { @@ -49,7 +47,7 @@ function single_block_cgb_editor_assets() { 'single_block-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ) // Dependencies, defined above. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: File modification time. ); // Styles. @@ -57,9 +55,9 @@ function single_block_cgb_editor_assets() { 'single_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function single_block_cgb_editor_assets(). // Hook: Editor assets. -add_action( 'enqueue_block_editor_assets', 'single_block_cgb_editor_assets' ); \ No newline at end of file +add_action( 'enqueue_block_editor_assets', 'single_block_cgb_editor_assets' ); diff --git a/examples/03-multi-block/src/init.php b/examples/03-multi-block/src/init.php index c2f96da5..75d313e6 100644 --- a/examples/03-multi-block/src/init.php +++ b/examples/03-multi-block/src/init.php @@ -4,7 +4,7 @@ * * Enqueue CSS/JS of all the blocks. * - * @since 1.0.0 + * @since 1.0.0 * @package CGB */ @@ -16,8 +16,7 @@ /** * Enqueue Gutenberg block assets for both frontend + backend. * - * `wp-editor`: WP editor styles. - * + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function multi_block_cgb_block_assets() { @@ -26,7 +25,7 @@ function multi_block_cgb_block_assets() { 'multi_block-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. array( 'wp-editor' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. ); } // End function multi_block_cgb_block_assets(). @@ -36,11 +35,10 @@ function multi_block_cgb_block_assets() { /** * Enqueue Gutenberg block assets for backend editor. * - * `wp-blocks`: includes block type registration and related functions. - * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. - * `wp-i18n`: internationalize the block's text. - * `wp-editor`: WP editor styles. - * + * @uses {wp-blocks} for block type registration & related functions. + * @uses {wp-element} for WP Element abstraction — structure of blocks. + * @uses {wp-i18n} to internationalize the block's text. + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function multi_block_cgb_editor_assets() { @@ -49,7 +47,7 @@ function multi_block_cgb_editor_assets() { 'multi_block-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ) // Dependencies, defined above. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: File modification time. ); // Styles. @@ -57,9 +55,9 @@ function multi_block_cgb_editor_assets() { 'multi_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function multi_block_cgb_editor_assets(). // Hook: Editor assets. -add_action( 'enqueue_block_editor_assets', 'multi_block_cgb_editor_assets' ); \ No newline at end of file +add_action( 'enqueue_block_editor_assets', 'multi_block_cgb_editor_assets' ); diff --git a/examples/04-multi-block-ejected/src/init.php b/examples/04-multi-block-ejected/src/init.php index c2f96da5..75d313e6 100644 --- a/examples/04-multi-block-ejected/src/init.php +++ b/examples/04-multi-block-ejected/src/init.php @@ -4,7 +4,7 @@ * * Enqueue CSS/JS of all the blocks. * - * @since 1.0.0 + * @since 1.0.0 * @package CGB */ @@ -16,8 +16,7 @@ /** * Enqueue Gutenberg block assets for both frontend + backend. * - * `wp-editor`: WP editor styles. - * + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function multi_block_cgb_block_assets() { @@ -26,7 +25,7 @@ function multi_block_cgb_block_assets() { 'multi_block-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. array( 'wp-editor' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. ); } // End function multi_block_cgb_block_assets(). @@ -36,11 +35,10 @@ function multi_block_cgb_block_assets() { /** * Enqueue Gutenberg block assets for backend editor. * - * `wp-blocks`: includes block type registration and related functions. - * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. - * `wp-i18n`: internationalize the block's text. - * `wp-editor`: WP editor styles. - * + * @uses {wp-blocks} for block type registration & related functions. + * @uses {wp-element} for WP Element abstraction — structure of blocks. + * @uses {wp-i18n} to internationalize the block's text. + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function multi_block_cgb_editor_assets() { @@ -49,7 +47,7 @@ function multi_block_cgb_editor_assets() { 'multi_block-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ) // Dependencies, defined above. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ) // Version: File modification time. ); // Styles. @@ -57,9 +55,9 @@ function multi_block_cgb_editor_assets() { 'multi_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function multi_block_cgb_editor_assets(). // Hook: Editor assets. -add_action( 'enqueue_block_editor_assets', 'multi_block_cgb_editor_assets' ); \ No newline at end of file +add_action( 'enqueue_block_editor_assets', 'multi_block_cgb_editor_assets' ); diff --git a/examples/05-a11y-input/src/init.php b/examples/05-a11y-input/src/init.php index 8d97f7f0..51e65f28 100644 --- a/examples/05-a11y-input/src/init.php +++ b/examples/05-a11y-input/src/init.php @@ -16,8 +16,7 @@ /** * Enqueue Gutenberg block assets for both frontend + backend. * - * `wp-editor`: WP editor styles. - * + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function a11y_input_cgb_block_assets() { @@ -26,7 +25,7 @@ function a11y_input_cgb_block_assets() { 'a11y_input-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. array( 'wp-editor' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. ); } // End function a11y_input_cgb_block_assets(). @@ -36,11 +35,10 @@ function a11y_input_cgb_block_assets() { /** * Enqueue Gutenberg block assets for backend editor. * - * `wp-blocks`: includes block type registration and related functions. - * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. - * `wp-i18n`: internationalize the block's text. - * `wp-editor`: WP editor styles. - * + * @uses {wp-blocks} for block type registration & related functions. + * @uses {wp-element} for WP Element abstraction — structure of blocks. + * @uses {wp-i18n} to internationalize the block's text. + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ function a11y_input_cgb_editor_assets() { @@ -49,7 +47,7 @@ function a11y_input_cgb_editor_assets() { 'a11y_input-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: File modification time. true // Enqueue the script in the footer. ); @@ -58,7 +56,7 @@ function a11y_input_cgb_editor_assets() { 'a11y_input-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function a11y_input_cgb_editor_assets(). diff --git a/packages/cgb-scripts/template/src/init.php b/packages/cgb-scripts/template/src/init.php index 7de18cd6..3df3b71e 100644 --- a/packages/cgb-scripts/template/src/init.php +++ b/packages/cgb-scripts/template/src/init.php @@ -16,19 +16,18 @@ /** * Enqueue Gutenberg block assets for both frontend + backend. * - * `wp-editor`: WP editor styles. - * + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ -function <% blockNamePHPLower %>_cgb_block_assets() { +function <% blockNamePHPLower %>_cgb_block_assets() { // phpcs:ignore // Styles. wp_enqueue_style( '<% blockNamePHPLower %>-cgb-style-css', // Handle. plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. array( 'wp-editor' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. ); -} // End function <% blockNamePHPLower %>_cgb_block_assets(). +} // Hook: Frontend assets. add_action( 'enqueue_block_assets', '<% blockNamePHPLower %>_cgb_block_assets' ); @@ -36,20 +35,19 @@ function <% blockNamePHPLower %>_cgb_block_assets() { /** * Enqueue Gutenberg block assets for backend editor. * - * `wp-blocks`: includes block type registration and related functions. - * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. - * `wp-i18n`: internationalize the block's text. - * `wp-editor`: WP editor styles. - * + * @uses {wp-blocks} for block type registration & related functions. + * @uses {wp-element} for WP Element abstraction — structure of blocks. + * @uses {wp-i18n} to internationalize the block's text. + * @uses {wp-editor} for WP editor styles. * @since 1.0.0 */ -function <% blockNamePHPLower %>_cgb_editor_assets() { +function <% blockNamePHPLower %>_cgb_editor_assets() { // phpcs:ignore // Scripts. wp_enqueue_script( '<% blockNamePHPLower %>-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: File modification time. true // Enqueue the script in the footer. ); @@ -58,9 +56,9 @@ function <% blockNamePHPLower %>_cgb_editor_assets() { '<% blockNamePHPLower %>-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. - // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. + // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); -} // End function <% blockNamePHPLower %>_cgb_editor_assets(). +} // Hook: Editor assets. add_action( 'enqueue_block_editor_assets', '<% blockNamePHPLower %>_cgb_editor_assets' );