PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.13
Booktics – Appointment Booking Calendar for Service Businesses v1.0.13
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 1.0.4 1.0.5 1.0.6 1.0.7 All 27 releases
booktics / core / shortcode / customer-shortcode.php

customer-shortcode.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.13, at core/shortcode/customer-shortcode.php

48 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Booktics\Shortcode;
4
5 /**
6 * Customer shortcode class
7 */
8 class Customer_Shortcode {
9 /**
10 * Constructor for customer shortcode
11 *
12 * @return void
13 */
14 public function __construct() {
15 add_shortcode( 'booktics_customer_panel', array( $this, 'render_customer_panel' ) );
16 }
17
18 /**
19 * Render customer panel
20 *
21 * @param array $attributes
22 *
23 * @return string
24 */
25 public function render_customer_panel( $attributes ) {
26
27 wp_enqueue_style( 'booktics-vendor' );
28 wp_enqueue_style( 'booktics-frontend' );
29
30 wp_enqueue_script( 'booktics-packages' );
31 wp_enqueue_script( 'booktics-frontend-scripts' );
32
33 // Check if user is logged in
34 if ( ! is_user_logged_in() ) {
35 $login_url = wp_login_url( get_permalink() );
36 return '<div class="booktics-login-required">
37 <h3>Customer Portal Access</h3>
38 <p>Please login to access your booking history.</p>
39 <a href="' . esc_url( $login_url ) . '" class="booktics-login-btn">Login</a>
40 </div>';
41 }
42
43 // Return container for React app
44 return '<div id="booktics-customer-dashboard"
45 data-user-id="' . get_current_user_id() . '">
46 </div>';
47 }
48 }