Overview

Namespaces

  • EventPost
  • None

Classes

  • EventPost
  • EventPost\Children
  • EventPost\Icons
  • EventPost\Multisite
  • EventPost\Settings
  • EventPost\Shortcodes
  • EventPost\Taxonomies
  • EventPost_Cal
  • EventPost_List
  • EventPost_Map
  • EventPost_Search
  • EventPostWeather

Functions

  • event_post_format_color
  • event_post_get_all_terms
  • eventdetails_block_init
  • EventPost
  • EventPost\product_event_tab
  • EventPost\woocommerce_product_tabs
  • EventPost\woocommerce_rich_result
  • eventpost_list_block_init
  • eventpost_timeline_block_init
  • eventscalendar_block_init
  • eventsmap_block_init
  • get_the_date_end
  • get_the_date_start
  • get_the_dates
  • get_the_location
  • the_date_end
  • the_date_start
  • the_dates
  • the_location
  • Overview
  • Namespace
  • Class
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 
<?php
/**
 * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
 *
 * @package event-post
 * @version 5.9.11
 * @since   5.2
 * @see     https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
 */

/**
 * Registers eventpost/calendar block
 */
function eventscalendar_block_init() {
    $dir_path = EventPost()->plugin_path;
    $dir = dirname( __DIR__ );

    $block_js = 'build/calendar/index.js';
    wp_register_script('event-post-calendar-block-editor-script',plugins_url( $block_js, $dir ),array('wp-blocks','wp-editor','wp-components','wp-i18n','wp-element',),filemtime( "$dir_path/$block_js" ));

    wp_register_script('event-post-calendar-block-editor-script-front-end', plugins_url( '/build/calendar/event-calendar.js', $dir ), ['jquery'], false, true);
    wp_set_script_translations( 'event-post-calendar-block-editor-script', 'event-post' );
    
    \register_block_type( $dir_path . '/build/calendar', array(
        'editor_script' => 'event-post-calendar-block-editor-script',
        'script' => 'event-post-calendar-block-editor-script-front-end',
        'render_callback' => array(EventPost()->Shortcodes, 'shortcode_cal'),
    ));
}
add_action( 'init', 'eventscalendar_block_init' );
API documentation generated by ApiGen