PluginProbe
QuadMenu – Mega Menu / 1.9.4
QuadMenu – Mega Menu v1.9.4
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 / divi.php

divi.php in QuadMenu – Mega Menu 1.9.4, at includes/3rd/divi.php

53 lines 1.1 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_Divi_Module {
8
9 public function __construct() {
10 add_action('et_builder_ready', array($this, 'module'));
11
12 add_action('et_builder_ready', array($this, 'cache'));
13
14 add_action('quadmenu_create_theme', array($this, 'clear_builder_cache'));
15
16 add_action('quadmenu_delete_theme', array($this, 'clear_builder_cache'));
17
18 add_filter('wp_nav_menu_args', array($this, 'fullwidth_menu'), 100000, 1);
19 }
20
21 function fullwidth_menu($args) {
22
23 if (class_exists('ET_Builder_Module')) {
24 if (isset($args['menu_class']) && strpos($args['menu_class'], 'fullwidth-menu') !== false) {
25 $args['theme_location'] = false;
26 }
27 }
28
29 return $args;
30 }
31
32 function cache() {
33
34 if (get_transient('quadmenu_create_theme')) {
35
36 et_update_option('et_pb_clear_templates_cache', true);
37
38 delete_transient('quadmenu_create_theme');
39 }
40 }
41
42 function module() {
43 require_once 'divi/module.php';
44 }
45
46 function clear_builder_cache() {
47 set_transient('quadmenu_create_theme', true, 30);
48 }
49
50 }
51
52 new QuadMenu_Divi_Module();
53