| 1 |
<?php |
| 2 |
/** |
| 3 |
* @version 1.0 |
| 4 |
* @package Booking Calendar |
| 5 |
* @subpackage Getenberg integration |
| 6 |
* @category inserting into posts |
| 7 |
* |
| 8 |
* @author wpdevelop |
| 9 |
* @link https://wpbookingcalendar.com/ |
| 10 |
* @email info@wpbookingcalendar.com |
| 11 |
* |
| 12 |
* @modified 2018-04-22 |
| 13 |
*/ |
| 14 |
|
| 15 |
// FixIn: 8.3.3.99. |
| 16 |
|
| 17 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 18 |
|
| 19 |
function wpbc_gutenberg_block_booking() { |
| 20 |
|
| 21 |
if ( function_exists( 'register_block_type' ) ) { |
| 22 |
|
| 23 |
$script_params = array( 'wp-blocks', 'wp-element', 'wpbc-modal' ); |
| 24 |
wp_register_script( 'gutenberg-wpbc-booking', wpbc_plugin_url( '/js/wpbc-gutenberg.js' ), $script_params, '1.0', array( 'in_footer' => WPBC_JS_IN_FOOTER ) ); |
| 25 |
wp_register_style( 'gutenberg-wpbc-editor', wpbc_plugin_url( '/css/wpbc-gutenberg.css' ), |
| 26 |
array( 'wp-edit-blocks' ), |
| 27 |
filemtime( plugin_dir_path( __FILE__ ) . '../../css/wpbc-gutenberg.css' ) |
| 28 |
); |
| 29 |
register_block_type( 'booking/booking', array( |
| 30 |
'editor_script' => 'gutenberg-wpbc-booking' |
| 31 |
, 'editor_style' => 'gutenberg-wpbc-editor' |
| 32 |
) ); |
| 33 |
} |
| 34 |
} |
| 35 |
add_action( 'init', 'wpbc_gutenberg_block_booking' ); |