Shortcode
4 months ago
AccessDeniedRedirect.php
1 year ago
AdminToolbar.php
1 year ago
ApiRoute.php
1 year ago
BackendMenu.php
1 year ago
BaseTrait.php
1 year ago
Capability.php
1 year ago
Content.php
4 months ago
Core.php
8 months ago
Hooks.php
1 year ago
Identity.php
1 month ago
Jwt.php
1 month ago
LoginRedirect.php
1 year ago
LogoutRedirect.php
1 month ago
Metaboxes.php
1 year ago
NotFoundRedirect.php
1 year ago
Policies.php
1 year ago
SecureLogin.php
1 year ago
SecurityAudit.php
1 year ago
Shortcodes.php
4 months ago
Urls.php
1 year ago
Welcome.php
1 year ago
Widgets.php
1 year ago
BaseTrait.php
63 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 | * Reusable elements for each service |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @version 7.0.0 |
| 15 | */ |
| 16 | trait AAM_Service_BaseTrait |
| 17 | { |
| 18 | |
| 19 | /** |
| 20 | * Single instance of itself |
| 21 | * |
| 22 | * @var object |
| 23 | * @access protected |
| 24 | * |
| 25 | * @version 7.0.0 |
| 26 | */ |
| 27 | protected static $instance = null; |
| 28 | |
| 29 | /** |
| 30 | * Bootstrap the service |
| 31 | * |
| 32 | * @return object |
| 33 | * |
| 34 | * @param boolean $reload |
| 35 | * @access public |
| 36 | * |
| 37 | * @version 7.0.0 |
| 38 | */ |
| 39 | public static function bootstrap($reload = false) |
| 40 | { |
| 41 | if (is_null(self::$instance) || $reload) { |
| 42 | self::$instance = new self; |
| 43 | } |
| 44 | |
| 45 | return self::$instance; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Get single instance of itself |
| 50 | * |
| 51 | * @return object |
| 52 | * |
| 53 | * @param boolean $reload |
| 54 | * @access public |
| 55 | * |
| 56 | * @version 7.0.0 |
| 57 | */ |
| 58 | public static function get_instance($reload = false) |
| 59 | { |
| 60 | return self::bootstrap($reload); |
| 61 | } |
| 62 | |
| 63 | } |