| @@ -18,12 +18,12 @@ | ||
| 18 | 18 | /** |
| 19 | 19 | * Enqueue Gutenberg block assets for both frontend + backend. |
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | -function uji_countdown_uji_block_assets() { // phpcs:ignore | |
| 22 | +function uji_countdown_2020_uji_block_assets() { // phpcs:ignore | |
| 23 | 23 | // Register block styles for both frontend + backend. |
| 24 | 24 | wp_register_style( |
| 25 | - 'uji_countdown-uji-style-css', // Handle. | |
| 25 | + 'uji_countdown_2020-uji-style-css', // Handle. | |
| 26 | 26 | plugins_url( 'dist/style-ujicount.css', dirname( __FILE__ ) ), // Block style CSS. |
| 27 | 27 | is_admin() ? array( 'wp-editor' ) : null, // Dependency to include the CSS after it. |
| 28 | 28 | null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. |
| 29 | 29 | ); |
| @@ -29,9 +29,9 @@ | ||
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | 31 | // Register block editor script for backend. |
| 32 | 32 | wp_register_script( |
| 33 | - 'uji_countdown-uji-block-js', // Handle. | |
| 33 | + 'uji_countdown_2020-uji-block-js', // Handle. | |
| 34 | 34 | plugins_url( '/dist/ujicount.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. |
| 35 | 35 | array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above. |
| 36 | 36 | null, // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. |
| 37 | 37 | true // Enqueue the script in the footer. |
| @@ -38,9 +38,9 @@ | ||
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | // Register block editor styles for backend. |
| 41 | 41 | wp_register_style( |
| 42 | - 'uji_countdown-uji-block-editor-css', // Handle. | |
| 42 | + 'uji_countdown_2020-uji-block-editor-css', // Handle. | |
| 43 | 43 | plugins_url( 'dist/style-ujicount.css', dirname( __FILE__ ) ), // Block editor CSS. |
| 44 | 44 | array( 'wp-edit-blocks' ), // Dependency to include the CSS after it. |
| 45 | 45 | null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. |
| 46 | 46 | ); |
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | 48 | // WP Localized globals. Use dynamic PHP stuff in JavaScript via `ujiGlobal` object. |
| 49 | 49 | wp_localize_script( |
| 50 | - 'uji_countdown-uji-block-js', | |
| 50 | + 'uji_countdown_2020-uji-block-js', | |
| 51 | 51 | 'ujiGlobal', // Array containing dynamic data for a JS Global. |
| 52 | 52 | [ |
| 53 | 53 | 'pluginDirPath' => plugin_dir_path( __DIR__ ), |
| 54 | 54 | 'pluginDirUrl' => plugin_dir_url( __DIR__ ), |
| @@ -62,15 +62,15 @@ | ||
| 62 | 62 | * @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts |
| 63 | 63 | * @since 1.16.0 |
| 64 | 64 | */ |
| 65 | 65 | register_block_type( |
| 66 | - 'urc/block-uji-countdown', array( | |
| 66 | + 'urc/block-uji-countdown-2020', array( | |
| 67 | 67 | // Enqueue blocks.style.build.css on both frontend & backend. |
| 68 | - 'style' => 'uji_countdown-uji-style-css', | |
| 68 | + 'style' => 'uji_countdown_2020-uji-style-css', | |
| 69 | 69 | // Enqueue blocks.build.js in the editor only. |
| 70 | - 'editor_script' => 'uji_countdown-uji-block-js', | |
| 70 | + 'editor_script' => 'uji_countdown_2020-uji-block-js', | |
| 71 | 71 | // Enqueue blocks.editor.build.css in the editor only. |
| 72 | - 'editor_style' => 'uji_countdown-uji-block-editor-css', | |
| 72 | + 'editor_style' => 'uji_countdown_2020-uji-block-editor-css', | |
| 73 | 73 | ) |
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | |
| @@ -76,5 +76,5 @@ | ||
| 76 | 76 | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // Hook: Block assets. |
| 80 | -add_action( 'init', 'uji_countdown_uji_block_assets' ); | |
| 80 | +add_action( 'init', 'uji_countdown_2020_uji_block_assets' ); | |