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