PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 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.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/frontend/shortcode.php +16 -12 1.0.20 → 1.0.64 View file →
@@ -6,8 +6,10 @@
6 6 */
7 7
8 8 namespace Timetics\Core\Frontend;
9 9
10 +defined( 'ABSPATH' ) || exit;
11 +
10 12 use Timetics\Utils\Singleton;
11 13 use Timetics;
12 14
13 15 /**
@@ -46,9 +48,8 @@
46 48 */
47 49 public function booking_form( $attribute ) {
48 50 wp_enqueue_style( 'timetics-vendor' );
49 51 wp_enqueue_style( 'timetics-frontend' );
50 - wp_enqueue_script( 'timetics-antd-scripts' );
51 52 wp_enqueue_script( 'timetics-flatpickr-scripts' );
52 53 wp_enqueue_script( 'timetics-frontend-scripts' );
53 54 wp_enqueue_script( 'calendar-locale' );
54 55
@@ -55,10 +56,17 @@
55 56 $id = isset( $attribute['id'] ) ? $attribute['id'] : '';
56 57 $data_controls = [
57 58 'id' => $id,
58 59 ];
59 - $controls = json_encode( $data_controls );
60 + $controls = wp_json_encode( $data_controls );
60 61
62 + $visibility = get_post_meta( $id, '_tt_apointment_visibility', true );
63 + $is_visible = 'enabled' === $visibility;
64 +
65 + if ( ! $is_visible && ! current_user_can( 'manage_options' ) ) {
66 + return '<div class="timetics-shortcode-wrapper"><p>' . esc_html__( 'This booking form is not available.', 'timetics' ) . '</p></div>';
67 + }
68 +
61 69 ob_start();
62 70 ?>
63 71 <div class="timetics-shortcode-wrapper">
64 72 <div class="timetics-single-booking-wrapper"
@@ -74,9 +82,8 @@
74 82 */
75 83 public function user_dashboard( $attribute ) {
76 84 wp_enqueue_style( 'timetics-vendor' );
77 85 wp_enqueue_style( 'timetics-frontend' );
78 - wp_enqueue_script( 'timetics-antd-scripts' );
79 86 wp_enqueue_script( 'timetics-frontend-scripts' );
80 87
81 88 $id = get_current_user_id();
82 89 $data_controls = [
@@ -81,9 +88,9 @@
81 88 $id = get_current_user_id();
82 89 $data_controls = [
83 90 'id' => $id,
84 91 ];
85 - $controls = json_encode( $data_controls );
92 + $controls = wp_json_encode( $data_controls );
86 93
87 94 ob_start();
88 95 if (is_user_logged_in()) {
89 96
@@ -97,9 +104,9 @@
97 104
98 105 }else{
99 106 ?>
100 107 <div class="timetics-userdashbaord-wrapper">
101 - <h3> <?php esc_html_e( 'You are not logged in', 'timetics' ); ?> <a href="<?php echo esc_url(wp_login_url()) ?>"><?php esc_html_e( 'Login', 'timetics' ); ?></a></h3>
108 + <h3> <?php esc_html_e( 'You are not logged in', 'timetics' ); ?> <a href="<?php echo esc_url( wp_login_url( get_permalink() ) ); ?>"><?php esc_html_e( 'Login', 'timetics' ); ?></a></h3>
102 109 </div>
103 110 <?php
104 111 }
105 112 return ob_get_clean();
@@ -108,9 +115,8 @@
108 115
109 116 public function eventin_seat_plan() {
110 117 wp_enqueue_style( 'timetics-vendor' );
111 118 wp_enqueue_style( 'timetics-frontend' );
112 - wp_enqueue_script( 'timetics-antd-scripts' );
113 119 wp_enqueue_script( 'timetics-flatpickr-scripts' );
114 120 wp_enqueue_script( 'timetics-frontend-scripts' );
115 121 }
116 122
@@ -121,18 +127,17 @@
121 127 */
122 128 public function meeting_list( $attribute ) {
123 129 wp_enqueue_style( 'timetics-vendor' );
124 130 wp_enqueue_style( 'timetics-frontend' );
125 - wp_enqueue_script( 'timetics-antd-scripts' );
126 131 wp_enqueue_script( 'timetics-flatpickr-scripts' );
127 132 wp_enqueue_script( 'timetics-frontend-scripts' );
128 133 wp_enqueue_script( 'calendar-locale' );
129 134 wp_enqueue_script( 'jquery' );
130 135
131 - wp_enqueue_script( 'timetics-meeting-filtering', TIMETICS_ASSETS_URL . 'js/meeting-filter.js', ['jquery'], time() );
136 + wp_enqueue_script( 'timetics-meeting-filtering', TIMETICS_ASSETS_URL . 'js/meeting-filter.js', ['jquery'], time(), true );
132 137
133 - $limit = isset( $attribute['limit'] ) ? $attribute['limit'] : '';
134 - $show_filter = isset( $attribute['show_filter'] ) && 'true' == $attribute['show_filter'] ? $attribute['show_filter'] : false;
138 + $timetics_limit = isset( $attribute['limit'] ) ? $attribute['limit'] : '';
139 + $timetics_show_filter = isset( $attribute['show_filter'] ) && 'true' == $attribute['show_filter'] ? $attribute['show_filter'] : false;
135 140
136 141 ob_start();
137 142 ?>
138 143 <div class="timetics-shortcode-wrapper">
@@ -155,9 +160,8 @@
155 160 */
156 161 public function category_meetings( $attribute ) {
157 162 wp_enqueue_style( 'timetics-vendor' );
158 163 wp_enqueue_style( 'timetics-frontend' );
159 - wp_enqueue_script( 'timetics-antd-scripts' );
160 164 wp_enqueue_script( 'timetics-flatpickr-scripts' );
161 165 wp_enqueue_script( 'timetics-frontend-scripts' );
162 166 wp_enqueue_script( 'calendar-locale' );
163 167
@@ -164,9 +168,9 @@
164 168 $id = isset( $attribute['id'] ) ? $attribute['id'] : '';
165 169 $data_controls = [
166 170 'id' => $id,
167 171 ];
168 - $controls = json_encode( $data_controls );
172 + $controls = wp_json_encode( $data_controls );
169 173
170 174 ob_start();
171 175 ?>
172 176 <div class="timetics-shortcode-wrapper">