PluginProbe
Animated Blocks on Scroll / 1.1.1
Animated Blocks on Scroll v1.1.1
1.1.6 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5
animated-blocks / init.php

init.php in Animated Blocks on Scroll 1.1.1, at init.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 * Blocks Initializer
4 *
5 * Enqueue CSS/JS of all the blocks.
6 *
7 * @package carousel-block
8 */
9
10 // Exit if accessed directly.
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 /**
16 * Enqueue block editor JavaScript and CSS.
17 */
18 function animated_block_editor_assets() {
19 // Block script.
20 wp_enqueue_script(
21 'ab-animated-block',
22 plugins_url( '/dist/blocks.build.js', __FILE__ ),
23 [ 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-editor' ],
24 filemtime( AB_PLUGIN_DIR . '/dist/blocks.build.js' ),
25 true
26 );
27
28 // Register block editor styles for backend.
29 wp_enqueue_style(
30 'ab-animated-block-editor',
31 plugins_url( '/dist/blocks.editor.build.css', __FILE__ ),
32 [ 'wp-edit-blocks' ],
33 filemtime( AB_PLUGIN_DIR . '/dist/blocks.editor.build.css' )
34 );
35 }
36
37 add_action( 'enqueue_block_editor_assets', 'animated_block_editor_assets' );
38
39 /**
40 * Enqueue block styles for frontend and editor.
41 */
42 function animated_block_assets() {
43 wp_enqueue_style(
44 'ab-animate',
45 plugins_url( '/dist/assets/css/animate.min.css', __FILE__ ),
46 [],
47 filemtime( AB_PLUGIN_DIR . '/dist/assets/css/animate.min.css' ),
48 false
49 );
50
51 if ( ! is_admin() ) {
52 wp_enqueue_style(
53 'ab-animated-block',
54 plugins_url( '/dist/blocks.style.build.css', __FILE__ ),
55 [],
56 filemtime( AB_PLUGIN_DIR . '/dist/blocks.style.build.css' )
57 );
58 }
59 }
60
61 add_action( 'enqueue_block_assets', 'animated_block_assets' );
62