| @@ -12,9 +12,9 @@ | ||
| 12 | 12 | * @return void |
| 13 | 13 | */ |
| 14 | 14 | public function __construct() { |
| 15 | 15 | add_shortcode( |
| 16 | - 'booktics-service-view', array( | |
| 16 | + 'booktics_service_view', array( | |
| 17 | 17 | $this, |
| 18 | 18 | 'render_service_view', |
| 19 | 19 | ) |
| 20 | 20 | ); |
| @@ -27,9 +27,19 @@ | ||
| 27 | 27 | * |
| 28 | 28 | * @return string |
| 29 | 29 | */ |
| 30 | 30 | public function render_service_view( $attributes ) { |
| 31 | - $id = isset( $attributes['id'] ) ? $attributes['id'] : ''; | |
| 31 | + $id = isset( $attributes['id'] ) ? absint( $attributes['id'] ) : 0; | |
| 32 | + | |
| 33 | + wp_enqueue_style( 'booktics-vendor' ); | |
| 34 | + wp_enqueue_style( 'booktics-frontend' ); | |
| 35 | + | |
| 36 | + wp_enqueue_script( 'booktics-packages' ); | |
| 37 | + wp_enqueue_script( 'booktics-frontend-scripts' ); | |
| 38 | + wp_enqueue_script( 'booktics-flatpickr-scripts' ); | |
| 39 | + | |
| 40 | + do_action( 'booktics_before_rendering_service_view_shortcode' ); | |
| 41 | + | |
| 32 | 42 | $post = get_post( $id ); |
| 33 | 43 | if ( ! $post || ( isset( $post->post_status ) && $post->post_status === 'deactive' ) ) { |
| 34 | 44 | return '<div class="booktics-shortcode-notice-wrapper"> |
| 35 | 45 | <div> |