PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.0-dev3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/admin/menu/admin-menu-manager.php +28 -1 4.2.0-dev23.32.0-dev3 View file →
@@ -10,14 +10,17 @@
10 10 exit; // Exit if accessed directly.
11 11 }
12 12
13 13 class Admin_Menu_Manager {
14 -
15 14 /**
16 15 * @var Admin_Menu_Item[]
17 16 */
18 17 private $items = [];
19 18
19 + public function __construct() {
20 + add_action( 'admin_init', [ $this, 'handle_external_redirects' ] );
21 + }
22 +
20 23 public function register( $item_slug, Admin_Menu_Item $item ) {
21 24 $this->items[ $item_slug ] = $item;
22 25 }
23 26
@@ -44,8 +47,32 @@
44 47
45 48 add_action( 'admin_head', function () {
46 49 $this->hide_invisible_menus();
47 50 } );
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 + }
48 75 }
49 76
50 77 private function register_wp_menus() {
51 78 do_action( 'elementor/admin/menu/register', $this );