Overview

Packages

  • event-post

Classes

  • EventPost
  • EventPost_Cal
  • EventPost_List
  • EventPost_Map
  • EventPost_Search
  • EventPost_Shortcodes
  • EventPostChild
  • EventPostMU
  • EventPostWeather

Functions

  • eventpost_list_block_front_init
  • eventpost_list_block_init
  • eventscalendar_block_front_init
  • eventscalendar_block_init
  • eventsmap_block_front_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
  • Package
  • 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: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 
<?php
/**
 * Functions to register client-side assets (scripts and stylesheets) for the
 * Gutenberg block.
 *
 * @package event-post
 */

/**
 * Registers all block assets so that they can be enqueued through Gutenberg in
 * the corresponding context.
 *
 * @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
 * @since 5.2
 */
function eventsmap_block_init() {
    global $EventPost;
    $dir = dirname( __DIR__ );
    $dir_path = $EventPost->plugin_path;
    $block_js = 'js/block-map.min.js';

    wp_register_script(
        'event-post-map-block-editor',
        plugins_url( $block_js, $dir ),
        array(
            'wp-blocks',
            'wp-i18n',
            'wp-element',
        ),
        filemtime( "$dir_path/$block_js" )
    );

    $editor_css = 'css/block-map.css';
    wp_register_style(
        'event-post-map-block-editor',
        plugins_url( $editor_css, $dir ),
        array(),
        filemtime( "$dir_path/$editor_css" )
    );

    wp_localize_script('event-post-map-block-editor', 'eventpost_gut_params', array(
        'maptiles' => $EventPost->maps,
        'map_interactions'=>$EventPost->map_interactions,
    ));
}
add_action( 'admin_init', 'eventsmap_block_init' );

function eventsmap_block_front_init() {
    global $EventPost;
    register_block_type( 'eventpost/map', array(
        'editor_script' => 'event-post-map-block-editor',
        'editor_style'  => 'event-post-map-block-editor',
        'render_callback' => array($EventPost->Shortcodes, 'shortcode_map'),
    ) );
}
add_action( 'init', 'eventsmap_block_front_init' );
API documentation generated by ApiGen