| 1 |
<?php |
| 2 |
/** |
| 3 |
* Settings Service Class |
| 4 |
* |
| 5 |
* @package SeQura/WC |
| 6 |
* @subpackage SeQura/WC/Services |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace SeQura\WC\Services\Service; |
| 10 |
|
| 11 |
/** |
| 12 |
* Settings Service Class |
| 13 |
*/ |
| 14 |
class Settings_Service implements Interface_Settings_Service { |
| 15 |
|
| 16 |
/** |
| 17 |
* Check if the current page is the settings page. |
| 18 |
*/ |
| 19 |
public function is_settings_page(): bool { |
| 20 |
return is_admin() && isset( $_GET['page'] ) && $this->get_page() === sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Get the configuration page slug. |
| 25 |
*/ |
| 26 |
public function get_page(): string { |
| 27 |
return 'sequra'; |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Get the configuration page parent slug. |
| 32 |
*/ |
| 33 |
public function get_parent_page(): string { |
| 34 |
return 'woocommerce'; |
| 35 |
} |
| 36 |
} |
| 37 |
|