PluginProbe
Hostinger Tools / 3.0.2
Hostinger Tools v3.0.2
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 3.0.2, at includes/Admin/Menu.php

59 lines 1.5 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\PluginSettings;
6 use Hostinger\Admin\Onboarding\Onboarding;
7 use Hostinger\WpHelper\Utils;
8 use Hostinger\WpMenuManager\Menus;
9
10 defined( 'ABSPATH' ) || exit;
11
12 class Menu {
13 public const MENU_SLUG = 'hostinger-tools';
14
15 public function __construct() {
16 add_filter('hostinger_admin_menu_bar_items', array( $this, 'add_admin_bar_items' ) );
17 add_filter('hostinger_menu_subpages', array( $this, 'sub_menu' ) );
18 }
19
20 public function add_admin_bar_items($menu_items): array {
21 $menu_items[] = array(
22 'id' => 'hostinger-tools-admin-bar',
23 'title' => __( 'Tools', 'hostinger' ),
24 'href' => admin_url( 'admin.php?page=' . self::MENU_SLUG )
25 );
26
27 return $menu_items;
28 }
29
30 public function sub_menu($submenus): array {
31 $tools_submenu = array(
32 'page_title' => __( 'Tools', 'hostinger' ),
33 'menu_title' => __( 'Tools', 'hostinger' ),
34 'capability' => 'manage_options',
35 'menu_slug' => self::MENU_SLUG,
36 'callback' => [$this, 'render_tools_menu_page'],
37 'menu_order' => 10
38 );
39
40 $submenus[] = $tools_submenu;
41
42 return $submenus;
43 }
44
45 public function render_tools_menu_page(): void {
46 echo Menus::renderMenuNavigation();
47 ?>
48 <div id="hostinger-tools-vue-app"/>
49
50
51 <?php
52 }
53
54 public function render(): void {
55 $onboarding = new Onboarding();
56 include_once __DIR__ . '/Views/Onboarding.php';
57 }
58 }
59