PluginProbe
Hostinger Tools / trunk
Hostinger Tools vtrunk
3.0.78 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 All 109 releases
hostinger / includes / Admin / Menu.php

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

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