| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/cwd/wp-content/plugins/master-addons/inc/modules/mega-menu/ |
Upload File : |
<?php
namespace MasterAddons\Modules\MegaMenu;
defined('ABSPATH') || exit;
class Master_Menu
{
public $dir;
public $url;
private static $plugin_path;
private static $plugin_url;
private static $_instance = null;
public function __construct()
{
// Current Path
$this->dir = dirname(__FILE__) . '/';
$this->url = self::plugin_url() . '/mega-menu/';
add_action('init', [$this, 'jltma_include_files']);
}
public function jltma_include_files()
{
include $this->dir . '/inc/cpt.php';
include $this->dir . '/inc/megamenu-assets.php';
include $this->dir . '/inc/rest-api.php';
include $this->dir . '/inc/api.php';
include $this->dir . '/inc/options.php';
include $this->dir . '/inc/walker-nav-menu.php';
include $this->dir . '/inc/cpt-api.php';
$this->jltma_megamenu_init();
}
public function jltma_megamenu_init(){
jltma_megamenu_assets();
jltma_megamenu_options();
jltma_megamenu_api()->init();
jltma_megamenu_cpt_api()->init();
if (is_admin()) {
if(!function_exists('\MasterAddons\Modules\MegaMenu\jltma_megamenu_cpt')){
new \MasterAddons\Modules\MegaMenu\JLTMA_Megamenu_Cpt();
}else{
\MasterAddons\Modules\MegaMenu\jltma_megamenu_cpt();
}
}
}
public static function plugin_url()
{
if (self::$plugin_url) {
return self::$plugin_url;
}
return self::$plugin_url = untrailingslashit(plugins_url('/', __FILE__));
}
public static function plugin_path()
{
if (self::$plugin_path) {
return self::$plugin_path;
}
return self::$plugin_path = untrailingslashit(plugin_dir_path(__FILE__));
}
public static function get_instance()
{
if (is_null(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}
}
/*
* Returns Instanse of the Master Mega Menu
*/
if (!function_exists('jltma_megamenu')) {
function jltma_megamenu()
{
return Master_Menu::get_instance();
}
}
jltma_megamenu();
/* Re-write flus */
register_activation_hook(__FILE__, 'jltma_flush_rewrites');
register_deactivation_hook(__FILE__, 'jltma_flush_rewrites');
if (!function_exists('jltma_flush_rewrites')) {
function jltma_flush_rewrites()
{
flush_rewrite_rules();
}
}