ServiceProvider.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Settings; |
| 4 | |
| 5 | use Give\Helpers\Hooks; |
| 6 | use Give\ServiceProviders\ServiceProvider as ServiceProviderInterface; |
| 7 | use Give\Settings\Security\Actions\RegisterPage; |
| 8 | use Give\Settings\Security\Actions\RegisterSection; |
| 9 | use Give\Settings\Security\Actions\RegisterSettings; |
| 10 | |
| 11 | /** |
| 12 | * Class ServiceProvider |
| 13 | * |
| 14 | * @since 3.17.0 |
| 15 | */ |
| 16 | class ServiceProvider implements ServiceProviderInterface |
| 17 | { |
| 18 | /** |
| 19 | * @since 3.17.0 |
| 20 | */ |
| 21 | public function register() |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @since 3.17.0 |
| 27 | */ |
| 28 | public function boot() |
| 29 | { |
| 30 | $this->registerSecuritySettings(); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @since 3.17.0 |
| 35 | */ |
| 36 | private function registerSecuritySettings(): void |
| 37 | { |
| 38 | Hooks::addFilter('give-settings_get_settings_pages', RegisterPage::class); |
| 39 | Hooks::addFilter('give_get_sections_security', RegisterSection::class); |
| 40 | Hooks::addFilter('give_get_settings_security', RegisterSettings::class); |
| 41 | } |
| 42 | } |
| 43 |