PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.28
Booktics – Appointment Booking Calendar for Service Businesses v1.0.28
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
booktics / core / onboard / init-onboard.php

init-onboard.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.28, at core/onboard/init-onboard.php

40 lines 991 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Booktics\Onboard;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 use Booktics\Contracts\Hookable_Service_Contract;
8
9 /**
10 * Handles initialization of onboarding process for first-time plugin installation
11 *
12 * @package Booktics/Onboard
13 */
14 class Init_Onboard implements Hookable_Service_Contract {
15
16 /**
17 * Register admin init action
18 *
19 * @return void
20 */
21 public function register() {
22 add_action( 'admin_init', array( $this, 'init' ) );
23 }
24
25 /**
26 * Initializes onboarding process by checking if plugin is installed
27 * If not installed, sets installation flag and redirects to onboarding page
28 *
29 * @return void
30 */
31 public function init() {
32 $is_installed = get_option( 'booktics_is_installed', false );
33 if ( ! $is_installed ) {
34 update_option( 'booktics_is_installed', true );
35 wp_safe_redirect( admin_url( 'admin.php?page=booktics#/onboard' ) );
36 exit();
37 }
38 }
39 }
40