PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.27
Booktics – Appointment Booking Calendar for Service Businesses v1.0.27
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
← All changes | core/shortcode/service-shortcode.php +22 -4 1.0.0 → 1.0.27 View file →
@@ -12,11 +12,11 @@
12 12 * @return void
13 13 */
14 14 public function __construct() {
15 15 add_shortcode(
16 - 'booktics-service-view', array(
17 - $this,
18 - 'render_service_view',
16 + 'booktics_service_view', array(
17 + $this,
18 + 'render_service_view',
19 19 )
20 20 );
21 21 }
22 22
@@ -27,9 +27,27 @@
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 +
42 + $post = get_post( $id );
43 + if ( ! $post || ( isset( $post->post_status ) && $post->post_status === 'deactive' ) ) {
44 + return '<div class="booktics-shortcode-notice-wrapper">
45 + <div>
46 + <h3>' . esc_html__( 'Service Unavailable', 'booktics' ) . '</h3>
47 + </div>
48 + </div>';
49 + }
32 50
33 51 return "<div class='booktics-shortcode-wrapper'>
34 52 <div class='booktics-single-service-wrapper'
35 53 data-id='" . esc_attr( $id ) . "'>