PluginProbe
Event Post / 5.10.2
Event Post v5.10.2
6.1.1 6.1.0 6.0.1 6.0.0 5.12.0 trunk 3.9 4.0 4.2 4.3 4.4 4.5 5.0 5.1 5.10.0 5.10.1 5.10.2 5.10.3 5.10.4 5.11.0 5.11.1 5.2 5.5 5.6 5.6.1 All 46 releases
event-post / inc / blocks / eventstimeline.php

eventstimeline.php in Event Post 5.10.2, at inc/blocks/eventstimeline.php

27 lines 813 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
4 *
5 * @package event-post
6 * @version 5.10.2
7 * @since 5.2
8 * @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
9 */
10
11 /**
12 * Registers eventpost/timeline block
13 */
14
15 function eventpost_timeline_block_init() {
16 $dir_path = EventPost()->plugin_path;
17 $dir = dirname( __DIR__ );
18
19 wp_register_script('event-post-timeline', plugins_url('/build/timeline/event-timeline.js', $dir), ['jquery'], false, true);
20
21 \register_block_type( $dir_path . '/build/timeline', array(
22 'render_callback' => array(EventPost()->Shortcodes, 'shortcode_timeline'),
23 'script' => 'event-post-timeline',
24 ));
25 }
26 add_action( 'wp_loaded', 'eventpost_timeline_block_init' );
27