ConfigPress.php
1 year ago
Content.php
1 year ago
Core.php
1 year ago
Manager.php
1 year ago
Multisite.php
1 year ago
Security.php
1 year ago
Service.php
1 year ago
Multisite.php
80 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * ====================================================================== |
| 5 | * LICENSE: This file is subject to the terms and conditions defined in * |
| 6 | * file 'license.txt', which is part of this source code package. * |
| 7 | * ====================================================================== |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Multisite settings |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @version 7.0.0 |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Settings_Multisite extends AAM_Backend_Feature_Abstract |
| 17 | { |
| 18 | |
| 19 | /** |
| 20 | * Default access capability to the collection of settings |
| 21 | * |
| 22 | * @version 7.0.0 |
| 23 | */ |
| 24 | const ACCESS_CAPABILITY = 'aam_manage_settings'; |
| 25 | |
| 26 | /** |
| 27 | * HTML template to render |
| 28 | * |
| 29 | * @version 7.0.0 |
| 30 | */ |
| 31 | const TEMPLATE = 'settings/multisite.php'; |
| 32 | |
| 33 | /** |
| 34 | * Get list of options |
| 35 | * |
| 36 | * @return array |
| 37 | * @access public |
| 38 | * |
| 39 | * @version 7.0.3 |
| 40 | */ |
| 41 | public static function getList() |
| 42 | { |
| 43 | $configs = AAM::api()->config; |
| 44 | $settings = [ |
| 45 | 'core.settings.multisite.members_only' => [ |
| 46 | 'title' => __('Non-Member Access Restriction', 'advanced-access-manager'), |
| 47 | 'description' => __('Limit subsite access to only members within the WordPress multisite network', 'advanced-access-manager'), |
| 48 | 'value' => $configs->get('core.settings.multisite.members_only') |
| 49 | ], |
| 50 | 'core.settings.multisite.sync' => [ |
| 51 | 'title' => __('Unified Multisite Configuration Sync', AAM_KEY), |
| 52 | 'description' => __('Effortlessly synchronize role and capability lists, along with all access settings (when configured)', AAM_KEY), |
| 53 | 'value' => $configs->get('core.settings.multisite.sync') |
| 54 | ], |
| 55 | ]; |
| 56 | |
| 57 | return apply_filters('aam_settings_list_filter', $settings, 'multisite'); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Register core settings UI |
| 62 | * |
| 63 | * @return void |
| 64 | * @access public |
| 65 | * |
| 66 | * @version 7.0.0 |
| 67 | */ |
| 68 | public static function register() |
| 69 | { |
| 70 | AAM_Backend_Feature::registerFeature((object)array( |
| 71 | 'uid' => 'settings-multisite', |
| 72 | 'position' => 15, |
| 73 | 'title' => __('Multisite Settings', 'advanced-access-manager'), |
| 74 | 'capability' => self::ACCESS_CAPABILITY, |
| 75 | 'type' => 'settings', |
| 76 | 'view' => __CLASS__ |
| 77 | )); |
| 78 | } |
| 79 | |
| 80 | } |