PluginProbe
QuadMenu – Mega Menu / 2.0.2
QuadMenu – Mega Menu v2.0.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 / vc.php

vc.php in QuadMenu – Mega Menu 2.0.2, at includes/3rd/vc.php

88 lines 2.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 add_action('init', 'quadmenu_vc', 50);
8
9 function quadmenu_vc() {
10
11 if (!class_exists('WPBakeryShortCode'))
12 return;
13
14 class WPBakeryShortCode_quadmenu_vc extends WPBakeryShortCode {
15
16 protected function content($atts, $content = null) {
17
18 if (function_exists('quadmenu')) {
19
20 $theme = '';
21
22 extract(shortcode_atts(array('menu' => '', 'theme' => ''), $atts));
23
24 $args = array(
25 'echo' => false,
26 'menu' => $menu,
27 'theme' => $theme,
28 'layout' => 'inherit'
29 );
30
31 return quadmenu($args);
32 }
33 }
34
35 }
36
37 if (!function_exists('vc_map'))
38 return;
39
40 vc_map(
41 array('base' => 'quadmenu_vc',
42 'name' => QUADMENU_PLUGIN_NAME,
43 'icon' => '',
44 'category' => esc_html__('Content', 'quadmenu'),
45 'description' => esc_html__('QuadMenu Shortcode', 'quadmenu'),
46 'params' => array(
47 array(
48 'type' => 'dropdown',
49 'heading' => esc_html__('Menus', 'quadmenu'),
50 'param_name' => 'menu',
51 'value' => quadmenu_vc_menus(),
52 'description' => esc_html__('Choose a menu.', 'quadmenu')
53 ),
54 array(
55 'type' => 'dropdown',
56 'heading' => esc_html__('Theme', 'quadmenu'),
57 'param_name' => 'theme',
58 'value' => quadmenu_vc_themes(),
59 'description' => esc_html__('Choose a theme location.', 'quadmenu')
60 ),
61 )
62 )
63 );
64 }
65
66 function quadmenu_vc_themes($themes = array()) {
67
68 global $quadmenu_themes;
69
70 foreach ($quadmenu_themes as $key => $theme) {
71
72 $themes[$theme] = $key;
73 }
74
75 return $themes;
76 }
77
78 function quadmenu_vc_menus($menus_ids = array()) {
79
80 $menus = wp_get_nav_menus();
81
82 foreach ($menus as $key => $menu) {
83 $menus_ids[$menu->name] = $menu->term_id;
84 }
85
86 return $menus_ids;
87 }
88