Plugin Directory

source: event-post/tags/5.9.5/inc/blocks/eventstimeline.php @ 3087067

Last change on this file since 3087067 was 3087067, checked in by bastho, 2 months ago

Deploy v5.9.5 - Set stable tag to 5.9.5

File size: 807 bytes
Line 
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.9.5
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
15function 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}
26add_action( 'init', 'eventpost_timeline_block_init' );
Note: See TracBrowser for help on using the repository browser.