PluginProbe
QuadMenu – Mega Menu / 1.9.2
QuadMenu – Mega Menu v1.9.2
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 / polylang.php

polylang.php in QuadMenu – Mega Menu 1.9.2, at includes/3rd/polylang.php

54 lines 1.2 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 if (defined('POLYLANG_BASENAME')) {
8
9 class QuadMenu_Polylang {
10
11 public function __construct() {
12 add_action('init', array($this, 'locations'), -11);
13 add_action('init', array($this, 'active'), -9);
14 }
15
16 function locations() {
17
18 global $quadmenu, $quadmenu_locations, $quadmenu_active_locations;
19
20 if (function_exists('pll_languages_list')) {
21 foreach (pll_languages_list() as $lang) {
22
23 foreach ($quadmenu_locations as $id => $location) {
24
25 if (strpos($id, "___{$lang}") !== false) {
26 unset($quadmenu_locations[$id]);
27 }
28 }
29 }
30 }
31 }
32
33 function active() {
34
35 global $quadmenu, $quadmenu_locations, $quadmenu_active_locations;
36
37 if (function_exists('pll_languages_list')) {
38
39 foreach ($quadmenu_active_locations as $id => $theme) {
40
41 foreach (pll_languages_list() as $lang) {
42
43 if (strpos($id, "___{$lang}") === false) {
44 $quadmenu_active_locations["{$id}___{$lang}"] = $quadmenu_active_locations[$id];
45 }
46 }
47 }
48 }
49 }
50
51 }
52
53 new QuadMenu_Polylang();
54 }