PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.14
Booktics – Appointment Booking Calendar for Service Businesses v1.0.14
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.14, at core/onboard/init-onboard.php

38 lines 949 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 use Booktics\Contracts\Hookable_Service_Contract;
6
7 /**
8 * Handles initialization of onboarding process for first-time plugin installation
9 *
10 * @package Booktics/Onboard
11 */
12 class Init_Onboard implements Hookable_Service_Contract {
13
14 /**
15 * Register admin init action
16 *
17 * @return void
18 */
19 public function register() {
20 add_action( 'admin_init', array( $this, 'init' ) );
21 }
22
23 /**
24 * Initializes onboarding process by checking if plugin is installed
25 * If not installed, sets installation flag and redirects to onboarding page
26 *
27 * @return void
28 */
29 public function init() {
30 $is_installed = get_option( 'booktics_is_installed', false );
31 if ( ! $is_installed ) {
32 update_option( 'booktics_is_installed', true );
33 wp_redirect( admin_url( 'admin.php?page=booktics#/onboard' ) );
34 exit();
35 }
36 }
37 }
38