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
ApiRoute.php
69 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 | * WordPress API manager |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @version 7.0.0 |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Main_ApiRoute 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_api_routes'; |
| 25 | |
| 26 | /** |
| 27 | * HTML template to render |
| 28 | * |
| 29 | * @version 7.0.0 |
| 30 | */ |
| 31 | const TEMPLATE = 'service/api-route.php'; |
| 32 | |
| 33 | /** |
| 34 | * Constructor |
| 35 | * |
| 36 | * @return void |
| 37 | * @access public |
| 38 | * |
| 39 | * @version 7.0.0 |
| 40 | */ |
| 41 | public function __construct() |
| 42 | { |
| 43 | // Customize the user experience |
| 44 | add_filter('aam_ui_api_route_mode_panel_filter', function() { |
| 45 | return AAM_Backend_View::get_instance()->loadPartial('api-route-mode'); |
| 46 | }); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Register API Routes service |
| 51 | * |
| 52 | * @return void |
| 53 | * @access public |
| 54 | * |
| 55 | * @version 7.0.0 |
| 56 | */ |
| 57 | public static function register() |
| 58 | { |
| 59 | AAM_Backend_Feature::registerFeature((object)array( |
| 60 | 'uid' => 'route', |
| 61 | 'position' => 50, |
| 62 | 'title' => __('API Routes', 'advanced-access-manager'), |
| 63 | 'capability' => self::ACCESS_CAPABILITY, |
| 64 | 'type' => 'main', |
| 65 | 'view' => __CLASS__ |
| 66 | )); |
| 67 | } |
| 68 | |
| 69 | } |