| @@ -1,28 +1,37 @@ | ||
| 1 | -<?php | |
| 2 | -namespace Booktics\Shortcode; | |
| 3 | - | |
| 4 | -/** | |
| 5 | - * Booking shortcode class | |
| 6 | - */ | |
| 7 | -class Booking_Shortcode { | |
| 8 | - /** | |
| 9 | - * Constructor for booking shortcode | |
| 10 | - * | |
| 11 | - * @return void | |
| 12 | - */ | |
| 13 | - public function __construct() { | |
| 14 | - add_shortcode( 'booktics_booking_form', array( $this, 'render_booking_form' ) ); | |
| 15 | - } | |
| 16 | - | |
| 17 | - | |
| 18 | - /** | |
| 19 | - * Render booking form | |
| 20 | - * | |
| 21 | - * @param array $attributes | |
| 22 | - * | |
| 23 | - * @return string | |
| 24 | - */ | |
| 25 | - public function render_booking_form( $attributes ) { | |
| 26 | - return '<div id="booktics-booking-form"></div>'; | |
| 27 | - } | |
| 28 | -} | |
| 1 | +<?php | |
| 2 | +namespace Booktics\Shortcode; | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * Booking shortcode class | |
| 6 | + */ | |
| 7 | +class Booking_Shortcode { | |
| 8 | + /** | |
| 9 | + * Constructor for booking shortcode | |
| 10 | + * | |
| 11 | + * @return void | |
| 12 | + */ | |
| 13 | + public function __construct() { | |
| 14 | + add_shortcode( 'booktics_booking_form', array( $this, 'render_booking_form' ) ); | |
| 15 | + } | |
| 16 | + | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * Render booking form | |
| 20 | + * | |
| 21 | + * @param array $attributes | |
| 22 | + * | |
| 23 | + * @return string | |
| 24 | + */ | |
| 25 | + public function render_booking_form( $attributes ) { | |
| 26 | + wp_enqueue_style( 'booktics-vendor' ); | |
| 27 | + wp_enqueue_style( 'booktics-frontend' ); | |
| 28 | + | |
| 29 | + wp_enqueue_script( 'booktics-packages' ); | |
| 30 | + wp_enqueue_script( 'booktics-frontend-scripts' ); | |
| 31 | + wp_enqueue_script( 'booktics-flatpickr-scripts' ); | |
| 32 | + | |
| 33 | + do_action( 'booktics_before_rendering_booking_form_shortcode' ); | |
| 34 | + | |
| 35 | + return '<div id="booktics-booking-form"></div>'; | |
| 36 | + } | |
| 37 | +} | |