| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
die('-1'); |
| 5 |
} |
| 6 |
|
| 7 |
if (!function_exists('is_quadmenu')) { |
| 8 |
|
| 9 |
function is_quadmenu($menu_id = false) { |
| 10 |
return QuadMenu::instance()->is_quadmenu($menu_id); |
| 11 |
} |
| 12 |
|
| 13 |
} |
| 14 |
|
| 15 |
if (!function_exists('quadmenu_get_menu_theme')) { |
| 16 |
|
| 17 |
function quadmenu_get_menu_theme($location = null, $menu_id = null) { |
| 18 |
|
| 19 |
global $quadmenu_themes, $quadmenu_active_locations; |
| 20 |
|
| 21 |
$theme = ''; |
| 22 |
|
| 23 |
if (isset($quadmenu_active_locations[$location])) { |
| 24 |
$theme = $quadmenu_active_locations[$location]; |
| 25 |
} |
| 26 |
|
| 27 |
if ($theme && isset($quadmenu_themes[$theme])) { |
| 28 |
return $theme; |
| 29 |
} |
| 30 |
|
| 31 |
if (is_array($quadmenu_themes)) { |
| 32 |
return current(array_keys($quadmenu_themes)); |
| 33 |
} |
| 34 |
|
| 35 |
return 'default_theme'; |
| 36 |
} |
| 37 |
|
| 38 |
} |
| 39 |
|
| 40 |
// Developers |
| 41 |
// ----------------------------------------------------------------------------- |
| 42 |
|
| 43 |
if (!function_exists('quadmenu_compiler_enqueue')) { |
| 44 |
|
| 45 |
function quadmenu_compiler_enqueue() { |
| 46 |
|
| 47 |
$screen = get_current_screen(); |
| 48 |
|
| 49 |
if (isset($screen->base) && !strpos($screen->base, QUADMENU_PANEL) === false) |
| 50 |
return; |
| 51 |
|
| 52 |
QuadMenu_Compiler::instance()->enqueue(); |
| 53 |
} |
| 54 |
|
| 55 |
} |
| 56 |
|
| 57 |
if (!function_exists('quadmenu_compiler_integration')) { |
| 58 |
|
| 59 |
function quadmenu_compiler_integration() { |
| 60 |
add_action('admin_init', 'quadmenu_compiler_enqueue', 26); |
| 61 |
} |
| 62 |
|
| 63 |
} |
| 64 |
|
| 65 |
if (!function_exists('quadmenu_do_compiler')) { |
| 66 |
|
| 67 |
function quadmenu_do_compiler() { |
| 68 |
QuadMenu_Compiler::instance()->do_compiler(true); |
| 69 |
} |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
if (!function_exists('quadmenu_compiler_variables')) { |
| 74 |
|
| 75 |
function quadmenu_compiler_variables() { |
| 76 |
return QuadMenu_Compiler::instance()->redux_compiler(); |
| 77 |
} |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
|