| 1 |
<?php |
| 2 |
|
| 3 |
namespace Codelight\GDPR\Installer; |
| 4 |
|
| 5 |
/** |
| 6 |
* Handle the installer wizard pages |
| 7 |
* |
| 8 |
* Class InstallerWizard |
| 9 |
* |
| 10 |
* @package Codelight\GDPR\Installer |
| 11 |
*/ |
| 12 |
class InstallerWizard |
| 13 |
{ |
| 14 |
/** |
| 15 |
* InstallerWizard constructor. |
| 16 |
*/ |
| 17 |
public function __construct() |
| 18 |
{ |
| 19 |
add_action('admin_menu', [$this, 'registerWizardPage']); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Register the installer page with WordPress |
| 24 |
*/ |
| 25 |
public function registerWizardPage() |
| 26 |
{ |
| 27 |
add_dashboard_page( '', '', 'manage_options', 'gdpr-setup', '' ); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Check if we are already on the installer page |
| 32 |
* |
| 33 |
* @return bool |
| 34 |
*/ |
| 35 |
public function isWizardPage() |
| 36 |
{ |
| 37 |
return isset($_GET['page']) && 'gdpr-setup' === $_GET['page']; |
| 38 |
} |
| 39 |
} |