PluginProbe
QuadMenu – Mega Menu / 1.8.5
QuadMenu – Mega Menu v1.8.5
3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 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.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 87 releases
quadmenu / includes / 3rd / elementor.php

elementor.php in QuadMenu – Mega Menu 1.8.5, at includes/3rd/elementor.php

71 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 die('-1');
5 }
6
7 class QuadMenu_Elementor {
8
9 public function __construct() {
10 //add_filter('wp_nav_menu_args', array($this, 'elementor'), 10, 1);
11 add_action('elementor/widgets/widgets_registered', array($this, 'module'));
12 add_action('elementor/widgets/widgets_registered', array($this, 'exclude'));
13 add_action('wp_footer', array($this, 'footer'));
14 }
15
16 function exclude($elementor) {
17
18 if (!class_exists('Elementor\\Plugin')) {
19 return;
20 }
21
22 $elementor->unregister_widget_type('wp-widget-quadmenu_widget');
23 }
24
25 function module($elementor) {
26
27 if (!class_exists('Elementor\\Plugin')) {
28 return;
29 }
30
31 require_once 'elementor/module.php';
32
33 $elementor->register_widget_type(new Elementor\QuadMenu());
34 }
35
36 function footer() {
37 if (!class_exists('Elementor\\Plugin')) {
38 return;
39 }
40 if (!Elementor\Plugin::$instance->editor->is_edit_mode() && !Elementor\Plugin::$instance->preview->is_preview_mode()) {
41 return;
42 }
43 ?>
44 <script>
45 jQuery(function ($) {
46 if (window.elementorFrontend) {
47
48 elementorFrontend.hooks.addAction('frontend/element_ready/global', function (response) {
49
50 var $quadmenu = $('nav#quadmenu', $(response));
51
52 if ($quadmenu.length) {
53
54 setTimeout(function () {
55 $quadmenu.quadmenu();
56 }, 100);
57
58 }
59
60
61 });
62 }
63 });
64 </script>
65 <?php
66
67 }
68 }
69
70 new QuadMenu_Elementor();
71