PluginProbe
Canvas / 2.4.9
Canvas v2.4.9
2.5.5 2.5.4 trunk 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 All 54 releases
canvas / components / basic-elements / class-block-cover.php

class-block-cover.php in Canvas 2.4.9, at components/basic-elements/class-block-cover.php

62 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Cover Block.
4 *
5 * @package Canvas
6 */
7
8 /**
9 * Initialize Cover block.
10 */
11 class CNVS_Block_Cover {
12
13 /**
14 * Initialize
15 */
16 public function __construct() {
17 add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
18 add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
19 }
20
21 /**
22 * Enqueue the block's assets for the editor.
23 */
24 public function enqueue_block_editor_assets() {
25 // Editor Scripts.
26 wp_enqueue_script(
27 'canvas-block-cover-editor-script',
28 plugins_url( 'block-cover/block.js', __FILE__ ),
29 array( 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-editor', 'lodash', 'jquery' ),
30 filemtime( plugin_dir_path( __FILE__ ) . 'block-cover/block.js' ),
31 true
32 );
33
34 // Styles.
35 wp_enqueue_style(
36 'canvas-block-cover-editor-style',
37 plugins_url( 'block-cover/block-editor.css', __FILE__ ),
38 array(),
39 filemtime( plugin_dir_path( __FILE__ ) . 'block-cover/block-editor.css' )
40 );
41
42 wp_style_add_data( 'canvas-block-cover-editor-style', 'rtl', 'replace' );
43 }
44
45 /**
46 * Enqueue assets for the front-end.
47 */
48 public function wp_enqueue_scripts() {
49 // Styles.
50 wp_enqueue_style(
51 'canvas-block-cover-style',
52 plugins_url( 'block-cover/block.css', __FILE__ ),
53 array(),
54 filemtime( plugin_dir_path( __FILE__ ) . 'block-cover/block.css' )
55 );
56
57 wp_style_add_data( 'canvas-block-cover-style', 'rtl', 'replace' );
58 }
59 }
60
61 new CNVS_Block_Cover();
62