PluginProbe
Hostinger Tools / 2.1.4
Hostinger Tools v2.1.4
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / includes / Admin / Menu.php

Menu.php in Hostinger Tools 2.1.4, at includes/Admin/Menu.php

66 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Hostinger\Admin;
4
5 use Hostinger\Admin\Onboarding\Onboarding;
6
7 defined( 'ABSPATH' ) || exit;
8
9 class Menu {
10 public function __construct() {
11 add_action( 'admin_menu', array( $this, 'admin_menu' ) );
12 }
13
14 public function admin_menu(): void {
15 $icon = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyMSAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjAwMDE5OTY1MyAxMS4yMzY4VjAuMDAwMzk4MjM1TDUuNjcxMzMgMy4wMjQzNlY4LjA4NjkxTDEzLjE3ODggOC4wOTA1M0wxOC45NDE5IDExLjIzNjhIMC4wMDAxOTk2NTNaTTE0LjcxNCA3LjE2MDQ3VjBMMjAuNTM4IDIuOTQ4NzJWMTAuNTQzN0wxNC43MTQgNy4xNjA0N1pNMTQuNzE0IDIwLjg5NDJWMTUuODc1M0w3LjE0ODYyIDE1Ljg3QzcuMTU1NjggMTUuOTAzNCAxLjI4OTg0IDEyLjY3MzUgMS4yODk4NCAxMi42NzM1TDIwLjUzOCAxMi43NjM4VjI0TDE0LjcxNCAyMC44OTQyWk0wIDIwLjg5NDFMMC4wMDAyMDE3NjkgMTMuNTUxNEw1LjY3MTMzIDE2Ljg1NDZWMjMuODQyN0wwIDIwLjg5NDFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';
16 add_menu_page(
17 __( 'Hostinger', 'hostinger' ),
18 __( 'Hostinger', 'hostinger' ),
19 'manage_options',
20 'hostinger',
21 array( $this, 'render' ),
22 $icon,
23 1
24 );
25
26 add_submenu_page(
27 'hostinger',
28 __( 'Get started', 'hostinger' ),
29 __( 'Get started', 'hostinger' ),
30 'manage_options',
31 'hostinger&#home',
32 '__return_empty_string',
33 2
34 );
35
36 add_submenu_page(
37 'hostinger',
38 __( 'Learn', 'hostinger' ),
39 __( 'Learn', 'hostinger' ),
40 'manage_options',
41 'hostinger&#learn',
42 '__return_empty_string',
43 3
44 );
45
46 if ( has_action( 'hostinger_ai_assistant_tab_view' ) && current_user_can( 'edit_posts' ) ) {
47 add_submenu_page(
48 'hostinger',
49 __( 'AI Content Creator', 'hostinger' ),
50 __( 'AI Content Creator', 'hostinger' ),
51 'manage_options',
52 'hostinger&#ai-assistant',
53 '__return_empty_string',
54 4
55 );
56 }
57
58 remove_submenu_page( 'hostinger', 'hostinger' );
59 }
60
61 public function render(): void {
62 $onboarding = new Onboarding();
63 include_once __DIR__ . '/Views/Onboarding.php';
64 }
65 }
66