| @@ -29,10 +29,10 @@ | ||
| 29 | 29 | */ |
| 30 | 30 | function wordpress_cgb_block_assets() { // phpcs:ignore |
| 31 | 31 | // Register block styles for both frontend + backend. |
| 32 | 32 | wp_register_style( |
| 33 | - 'wordpress-cgb-style-css', // Handle. | |
| 34 | - plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS. | |
| 33 | + 'codoc-style-css', // Handle. | |
| 34 | + plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. | |
| 35 | 35 | array( 'wp-editor' ), // Dependency to include the CSS after it. |
| 36 | 36 | null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. |
| 37 | 37 | ); |
| 38 | 38 | |
| @@ -37,19 +37,19 @@ | ||
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // Register block editor script for backend. |
| 40 | 40 | wp_register_script( |
| 41 | - 'wordpress-cgb-block-js', // Handle. | |
| 42 | - plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. | |
| 41 | + 'codoc-block-js', // Handle. | |
| 42 | + plugins_url( '/dist/blocks.build.js?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. | |
| 43 | 43 | array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above. |
| 44 | 44 | null, // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. |
| 45 | 45 | true // Enqueue the script in the footer. |
| 46 | 46 | ); |
| 47 | - | |
| 47 | + | |
| 48 | 48 | // Register block editor styles for backend. |
| 49 | 49 | wp_register_style( |
| 50 | - 'wordpress-cgb-block-editor-css', // Handle. | |
| 51 | - plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. | |
| 50 | + 'codoc-block-editor-css', // Handle. | |
| 51 | + plugins_url( 'dist/blocks.editor.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block editor CSS. | |
| 52 | 52 | array( 'wp-edit-blocks' ), // Dependency to include the CSS after it. |
| 53 | 53 | null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. |
| 54 | 54 | ); |
| 55 | 55 | |
| @@ -65,13 +65,13 @@ | ||
| 65 | 65 | */ |
| 66 | 66 | register_block_type( |
| 67 | 67 | 'cgb/block-wordpress', array( |
| 68 | 68 | // Enqueue blocks.style.build.css on both frontend & backend. |
| 69 | - 'style' => 'wordpress-cgb-style-css', | |
| 69 | + 'style' => 'codoc-style-css', | |
| 70 | 70 | // Enqueue blocks.build.js in the editor only. |
| 71 | - 'editor_script' => 'wordpress-cgb-block-js', | |
| 71 | + 'editor_script' => 'codoc-block-js', | |
| 72 | 72 | // Enqueue blocks.editor.build.css in the editor only. |
| 73 | - 'editor_style' => 'wordpress-cgb-block-editor-css', | |
| 73 | + 'editor_style' => 'codoc-block-editor-css', | |
| 74 | 74 | ) |
| 75 | 75 | ); |
| 76 | 76 | } |
| 77 | 77 | |