Uname:
Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software:
Apache
PHP version:
8.0.30 [ PHP INFO ] PHP os:
Linux
Server Ip:
145.239.37.162
Your Ip:
216.73.216.190
User:
dreampi (1009562) | Group:
users (100)
Safe Mode:
OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl
<?php
defined('ABSPATH') || exit();
class Motiox_Admin_MegaMenu {
public function __construct() {
$this->includes();
add_action('admin_init', array($this, 'process_create_related'), 1);
add_filter("theme_elementor_library_templates", [$this, 'add_page_templates'], 10, 4);
}
private function includes() {
include_once get_template_directory() . '/inc/megamenu/includes/admin/class-admin-assets.php';
}
public function add_page_templates($page_templates, $wp_theme, $post) {
$page_templates['inc/megamenu/templates/single-menu.php'] = 'Single Mega Menu';
return $page_templates;
}
public function process_create_related($post_id) {
if (isset($_GET['motiox-menu-createable']) && isset($_GET['menu_id']) && absint($_GET['menu_id'])) {
$menu_id = (int)$_GET['menu_id'];
$related_id = motiox_megamenu_get_post_related_menu($menu_id);
if (!$related_id) {
motiox_megamenu_create_related_post($menu_id);
$related_id = motiox_megamenu_get_post_related_menu($menu_id);
}
if ($related_id && isset($_REQUEST['menu_id']) && is_admin()) {
$url = Elementor\Plugin::instance()->documents->get($related_id)->get_edit_url();
$action = add_query_arg(array('motiox-menu-editable' => 1), $url);
wp_redirect($action);
die;
}
exit();
}
}
}
new Motiox_Admin_MegaMenu();