File: /home/ezpgggd/www/wp-content/plugins/wallsio/block/src/init.php
<?php
/**
* Blocks Initializer
*
* Enqueue CSS/JS of all the blocks.
*
* @since 1.0.0
* @package CGB
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Enqueue Gutenberg block assets for both frontend + backend.
*
* `wp-blocks`: includes block type registration and related functions.
*
* @since 1.0.0
*/
function wallsio_cgb_block_assets() {
// Styles.
wp_enqueue_style(
'wallsio-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.
wallsio_asset_version()
);
} // End function block_cgb_block_assets().
// Hook: Frontend assets.
add_action( 'enqueue_block_assets', 'wallsio_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`: To internationalize the block's text.
*
* @since 1.0.0
*/
function wallsio_cgb_editor_assets() {
// Scripts.
wp_enqueue_script(
'wallsio-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', 'lodash' ), // Dependencies, defined above.
wallsio_asset_version()
);
// Styles.
wp_enqueue_style(
'wallsio-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.
wallsio_asset_version()
);
} // End function block_cgb_editor_assets().
// Hook: Editor assets.
add_action( 'enqueue_block_editor_assets', 'wallsio_cgb_editor_assets');