PluginProbe
QuadMenu – Mega Menu / 3.3.3
QuadMenu – Mega Menu v3.3.3
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 / lib / class-functions.php

class-functions.php in QuadMenu – Mega Menu 3.3.3, at lib/class-functions.php

92 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use QuadLayers\QuadMenu\Plugin;
4 use QuadLayers\QuadMenu\Compiler;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 die( '-1' );
8 }
9
10
11 if ( ! function_exists( 'quadmenu_get_translated_home_url' ) ) {
12 function quadmenu_get_translated_home_url( $param ) {
13 $home_url = home_url();
14 if ( function_exists( 'pll_home_url' ) ) {
15 $home_url = pll_home_url( $param );
16 }
17 if ( function_exists( 'wpml_get_home_url' ) ) {
18 $home_url = wpml_get_home_url( $param );
19 }
20 return $home_url;
21 }
22 }
23
24 if ( ! function_exists( 'is_quadmenu' ) ) {
25
26 function is_quadmenu( $menu_id = false ) {
27 return Plugin::instance()->is_quadmenu( $menu_id );
28 }
29 }
30
31 if ( ! function_exists( 'quadmenu_get_menu_theme' ) ) {
32
33 function quadmenu_get_menu_theme( $location = null, $menu_id = null ) {
34
35 global $quadmenu_themes, $quadmenu_active_locations;
36
37 $theme = '';
38
39 if ( isset( $quadmenu_active_locations[ $location ] ) ) {
40 $theme = $quadmenu_active_locations[ $location ];
41 }
42
43 if ( $theme && isset( $quadmenu_themes[ $theme ] ) ) {
44 return $theme;
45 }
46
47 if ( is_array( $quadmenu_themes ) ) {
48 return current( array_keys( $quadmenu_themes ) );
49 }
50
51 return 'default_theme';
52 }
53 }
54
55 // Developers
56 // -----------------------------------------------------------------------------
57
58 if ( ! function_exists( 'quadmenu_compiler_enqueue' ) ) {
59
60 function quadmenu_compiler_enqueue() {
61
62 $screen = get_current_screen();
63
64 if ( isset( $screen->base ) && ! strpos( $screen->base, QUADMENU_PANEL ) === false ) {
65 return;
66 }
67
68 Compiler::instance()->enqueue();
69 }
70 }
71
72 if ( ! function_exists( 'quadmenu_compiler_integration' ) ) {
73
74 function quadmenu_compiler_integration() {
75 add_action( 'admin_init', 'quadmenu_compiler_enqueue', 26 );
76 }
77 }
78
79 if ( ! function_exists( 'quadmenu_do_compiler' ) ) {
80
81 function quadmenu_do_compiler() {
82 Compiler::instance()->do_compiler( true );
83 }
84 }
85
86 if ( ! function_exists( 'quadmenu_compiler_variables' ) ) {
87
88 function quadmenu_compiler_variables() {
89 return Compiler::instance()->redux_compiler();
90 }
91 }
92