?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin/Dashboard/



?? Go up: /home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin

?? Viewing: DashboardMenu.php

<?php

namespace KS_PAC_DCFH\Admin\Dashboard;

if (!defined('ABSPATH')) {
    exit;
}

class DashboardMenu
{
    public function load(): void
    {
        add_action('admin_menu', [$this, 'add_menu_item']);
        add_action('admin_menu', [$this, 'remove_default_submenu']);
    }

    public function add_menu_item()
    {
        global $menu;
        $found = false;
        foreach ($menu as $item) {
            if (isset($item[2]) && $item[2] === 'pee-aye-creative') {
                $found = true;
                break;
            }
        }
        if (!$found) {
            add_menu_page(
                __('Pee-Aye Creative', 'divi-contact-form-helper'), // phpcs:ignore
                __('Pee-Aye Creative', 'divi-contact-form-helper'), // phpcs:ignore
                'manage_options',
                'pee-aye-creative',
                '__return_null',
                KS_PAC_DCFH_PLUGIN_URL.'/dashboard/assets/images/admin-menu-logo.png'
            );
        }
        add_submenu_page(
            'pee-aye-creative',
            'Divi Contact Form Helper',
            'Divi Contact Form Helper',
            'manage_options',
            'divi-contact-form-helper',
            function () {
                echo '<div id="ks-pac-dcfh-app"><div id="ks-pac-dcfh-app-inner"></div></div>';

            }
        );
    }

    public function remove_default_submenu(): void
    {
        remove_submenu_page('pee-aye-creative', 'pee-aye-creative');
    }
}



??

??