onboarding.php
| 1 | <?php |
| 2 | /** |
| 3 | * Onboarding Class |
| 4 | * |
| 5 | * Handles the onboarding process for the SureForms plugin. |
| 6 | * |
| 7 | * @package sureforms |
| 8 | */ |
| 9 | |
| 10 | namespace SRFM\Inc; |
| 11 | |
| 12 | use SRFM\Inc\Traits\Get_Instance; |
| 13 | |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; // Exit if accessed directly. |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Onboarding Class |
| 20 | * |
| 21 | * Handles the onboarding process for the SureForms plugin. |
| 22 | */ |
| 23 | class Onboarding { |
| 24 | use Get_Instance; |
| 25 | |
| 26 | /** |
| 27 | * Onboarding completion setting key. |
| 28 | * |
| 29 | * @var string |
| 30 | */ |
| 31 | private $onboarding_status_key = 'onboarding_completed'; |
| 32 | |
| 33 | /** |
| 34 | * Set onboarding completion status. |
| 35 | * |
| 36 | * @since 1.9.1 |
| 37 | * @param string $completed Whether the onboarding is completed. |
| 38 | * @return void |
| 39 | */ |
| 40 | public function set_onboarding_status( $completed = 'no' ) { |
| 41 | Helper::update_srfm_option( $this->onboarding_status_key, $completed ); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Get onboarding completion status. |
| 46 | * |
| 47 | * @since 1.9.1 |
| 48 | * @return bool |
| 49 | */ |
| 50 | public function get_onboarding_status() { |
| 51 | return Helper::get_srfm_option( $this->onboarding_status_key, 'no' ) === 'yes'; |
| 52 | } |
| 53 | } |
| 54 |