| @@ -15,12 +15,8 @@ | ||
| 15 | 15 | * @var Admin_Menu_Item[] |
| 16 | 16 | */ |
| 17 | 17 | private $items = []; |
| 18 | 18 | |
| 19 | - public function __construct() { | |
| 20 | - add_action( 'admin_init', [ $this, 'handle_external_redirects' ] ); | |
| 21 | - } | |
| 22 | - | |
| 23 | 19 | public function register( $item_slug, Admin_Menu_Item $item ) { |
| 24 | 20 | $this->items[ $item_slug ] = $item; |
| 25 | 21 | } |
| 26 | 22 | |
| @@ -47,32 +43,8 @@ | ||
| 47 | 43 | |
| 48 | 44 | add_action( 'admin_head', function () { |
| 49 | 45 | $this->hide_invisible_menus(); |
| 50 | 46 | } ); |
| 51 | - | |
| 52 | - add_action( 'elementor/admin/menu/register', [ $this, 'register_cloud_hosting_plans' ], 999 ); | |
| 53 | - } | |
| 54 | - | |
| 55 | - /** | |
| 56 | - * Register Cloud Hosting Plans menu item. | |
| 57 | - */ | |
| 58 | - public function register_cloud_hosting_plans( Admin_Menu_Manager $admin_menu ) { | |
| 59 | - $admin_menu->register( 'go_cloud_hosting_plans', new Cloud_Hosting_Plans_Menu_Item() ); | |
| 60 | - } | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * Handle external redirects. | |
| 64 | - */ | |
| 65 | - public function handle_external_redirects() { | |
| 66 | - if ( empty( $_GET['page'] ) ) { | |
| 67 | - return; | |
| 68 | - } | |
| 69 | - | |
| 70 | - if ( 'go_cloud_hosting_plans' === $_GET['page'] ) { | |
| 71 | - wp_redirect( Cloud_Hosting_Plans_Menu_Item::get_url() ); | |
| 72 | - | |
| 73 | - exit; | |
| 74 | - } | |
| 75 | 47 | } |
| 76 | 48 | |
| 77 | 49 | private function register_wp_menus() { |
| 78 | 50 | do_action( 'elementor/admin/menu/register', $this ); |