PluginProbe
Hostinger Tools / 1.9.9
Hostinger Tools v1.9.9
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 / class-hostinger-admin-menu.php

class-hostinger-admin-menu.php in Hostinger Tools 1.9.9, at includes/admin/class-hostinger-admin-menu.php

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