AccessDeniedRedirect.php
1 year ago
AdminToolbar.php
1 year ago
ApiRoute.php
1 year ago
BackendMenu.php
1 year ago
Capability.php
1 year ago
Content.php
1 year ago
Identity.php
1 year ago
Jwt.php
1 year ago
LoginRedirect.php
1 year ago
LogoutRedirect.php
1 year ago
Metabox.php
1 year ago
NotFoundRedirect.php
1 year ago
Policy.php
1 year ago
Url.php
1 year ago
Welcome.php
1 year ago
Widget.php
1 year ago
Widget.php
68 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 | * Backend widgets manager |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @version 7.0.0 |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Main_Widget extends AAM_Backend_Feature_Abstract |
| 17 | { |
| 18 | |
| 19 | /** |
| 20 | * Default access capability to the service |
| 21 | * |
| 22 | * @version 7.0.0 |
| 23 | */ |
| 24 | const ACCESS_CAPABILITY = 'aam_manage_widgets'; |
| 25 | |
| 26 | /** |
| 27 | * HTML template to render |
| 28 | * |
| 29 | * @version 7.0.0 |
| 30 | */ |
| 31 | const TEMPLATE = 'service/widget.php'; |
| 32 | |
| 33 | /** |
| 34 | * Get the complete list of admin screens AAM uses to index metaboxes |
| 35 | * |
| 36 | * @return array |
| 37 | * @access public |
| 38 | * |
| 39 | * @version 7.0.0 |
| 40 | */ |
| 41 | protected function get_screen_urls() |
| 42 | { |
| 43 | return [ |
| 44 | esc_url(add_query_arg('init', 'widget', admin_url('index.php'))) |
| 45 | ]; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Register metabox service UI |
| 50 | * |
| 51 | * @return void |
| 52 | * @access public |
| 53 | * |
| 54 | * @version 7.0.0 |
| 55 | */ |
| 56 | public static function register() |
| 57 | { |
| 58 | AAM_Backend_Feature::registerFeature((object)array( |
| 59 | 'uid' => 'widget', |
| 60 | 'position' => 10, |
| 61 | 'title' => __('Widgets', 'advanced-access-manager'), |
| 62 | 'capability' => self::ACCESS_CAPABILITY, |
| 63 | 'type' => 'main', |
| 64 | 'view' => __CLASS__ |
| 65 | )); |
| 66 | } |
| 67 | |
| 68 | } |