# event-post/5.10.2/inc/blocks/eventscalendar.php

Event Post, version 5.10.2. 31 lines.

- Page: https://pluginprobe.com/plugins/event-post/5.10.2/code/inc/blocks/eventscalendar.php
- Raw: https://pluginprobe.com/plugins/event-post/5.10.2/raw/inc/blocks/eventscalendar.php
- Modified: 2025-05-21T10:43:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/event-post/5.10.2/code/inc/blocks/eventscalendar.php#L10-L20`.

```php
<?php
/**
 * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
 *
 * @package event-post
 * @version 5.10.2
 * @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( 'wp_loaded', 'eventscalendar_block_init' );

```
