/home/altere25/vaultcryptocurrency.io/wp-content/plugins/groovy-menu/template
NameSizeModeActions
Header.php555920644editdlrm
index.php280644editdlrm
loader.php2300644editdlrm
Preview.php47070644editdlrm
PreviewModal.php41580644editdlrm
Edit: /home/altere25/vaultcryptocurrency.io/wp-content/plugins/groovy-menu/template/Header.php (55592B)
GroovyMenuUtils::getMasterNavmenu(), 'gm_preset_id' => GroovyMenuUtils::getMasterPreset(), 'theme_location' => GroovyMenuUtils::getMasterLocation(), 'echo' => false, 'gm_echo' => true, 'gm_pre_storage' => false, 'depth' => 0, // limit the depth of the nav. 'is_disable' => false, ); $args['menu'] = ( empty( $args['menu'] ) || 'default' === $args['menu'] ) ? GroovyMenuUtils::getMasterNavmenu() : $args['menu']; $args['gm_preset_id'] = ( empty( $args['gm_preset_id'] ) || 'default' === $args['gm_preset_id'] ) ? GroovyMenuUtils::getMasterPreset() : $args['gm_preset_id']; // Merge incoming params with defaults. $args = wp_parse_args( $args, $defaults_args ); // We must rewrite some params for excluding issues in design and styles. $args['menu_class'] = 'gm-navbar-nav'; // adding custom nav class. $args['before'] = ''; // before the menu. $args['after'] = ''; // after the menu. $args['link_before'] = ''; // before each link. $args['link_after'] = ''; // after each link. $args['fallback_cb'] = ''; // fallback function (if there is one). $args['items_wrap'] = ''; $args['walker'] = new \GroovyMenu\FrontendWalker(); $args['container'] = false; $args['groovy_menu'] = true; $args['gm_navigation_mobile'] = false; $args['echo'] = false; $nav_menu_obj = ! empty( $args['menu'] ) ? wp_get_nav_menu_object( $args['menu'] ) : null; if ( $args['menu'] && ! $nav_menu_obj ) { $args['menu'] = ''; } elseif ( $args['menu'] && ! empty( $nav_menu_obj->term_id ) ) { $args['menu'] = $nav_menu_obj->term_id; } $category_options = gm_get_current_category_options(); if ( $category_options && isset( $category_options['custom_options'] ) && '1' === $category_options['custom_options'] ) { $cat_preset = GroovyMenuCategoryPreset::getCurrentPreset(); $cat_nav_menu = GroovyMenuCategoryPreset::getCurrentNavMenu(); if ( $cat_preset ) { $args['gm_preset_id'] = $cat_preset; } if ( $cat_nav_menu ) { $nav_menu_obj = ! empty( $cat_nav_menu ) ? wp_get_nav_menu_object( $cat_nav_menu ) : null; if ( ! empty( $nav_menu_obj ) && ! empty( $nav_menu_obj->term_id ) ) { $args['menu'] = $nav_menu_obj->term_id; } } } // Check if GM stored before, if so - return html. $current_gm_id = \GroovyMenu\PreStorage::get_instance()->get_id( $args ); $stored_pre_gm = \GroovyMenu\PreStorage::get_instance()->get_stored_gm_list(); if ( in_array( $current_gm_id, $stored_pre_gm, true ) ) { $stored_gm_data = \GroovyMenu\PreStorage::get_instance()->get_gm( $current_gm_id ); if ( $stored_gm_data ) { if ( $args['gm_echo'] ) { echo ( ! empty( $stored_gm_data['gm_html'] ) ) ? $stored_gm_data['gm_html'] : ''; return ''; } else { return $stored_gm_data['gm_html']; } } } $locations = get_theme_mod( 'nav_menu_locations' ); $is_menu_empty = false; if ( ! $args['menu'] ) { if ( empty( $locations[ $args['theme_location'] ] ) ) { $is_menu_empty = true; } else { $nav_menu_obj = wp_get_nav_menu_object( $locations[ $args['theme_location'] ] ); if ( ! $nav_menu_obj ) { $is_menu_empty = true; } } } if ( 'default' === $args['gm_preset_id'] ) { $args['gm_preset_id'] = null; } if ( 'none' === $args['gm_preset_id'] ) { return ''; } $styles = new GroovyMenuStyle( $args['gm_preset_id'] ); // Check conditions if need prevent output Groovy Menu. $display_gm_when_menu_block_edit = $styles->getGlobal( 'tools', 'display_gm_when_menu_block_edit' ); if ( ! $display_gm_when_menu_block_edit ) { $prevent_gm_output = apply_filters( 'groovy_menu_prevent_output_html', false ); // Prevent output if self gm_menu_block post_type preview. if ( $prevent_gm_output || 'gm_menu_block' === get_post_type() ) { return ''; } } if ( empty( $groovyMenuSettings ) ) { $serialized_styles = $styles->serialize(); $groovyMenuSettings = $serialized_styles; $groovyMenuSettings['preset'] = array( 'id' => $styles->getPreset()->getId(), 'name' => $styles->getPreset()->getName(), ); $groovyMenuSettings['nav_menu_data'] = array( 'id' => $args['menu'], ); $groovyMenuSettings['extra_navbar_classes'] = $styles->getHtmlClasses(); } $preset_id = isset( $groovyMenuSettings['preset']['id'] ) ? $groovyMenuSettings['preset']['id'] : 'all'; $compiled_css = $styles->get( 'general', 'compiled_css' . ( is_rtl() ? '_rtl' : '' ) ); $additional_html_class = ''; if ( ! empty( $groovyMenuSettings['mobileDisableDesktop'] ) && $groovyMenuSettings['mobileDisableDesktop'] ) { $additional_html_class .= ' gm-disable-desktop-view'; } if ( ! empty( $groovyMenuSettings['extra_navbar_classes'] ) ) { $additional_html_class .= ' ' . implode( ' ', $groovyMenuSettings['extra_navbar_classes'] ); } $header_style = intval( $groovyMenuSettings['header']['style'] ); if ( class_exists( 'GroovyMenuActions' ) ) { // Do custom shortcodes from preset. GroovyMenuActions::do_preset_shortcodes( $styles ); if ( $groovyMenuSettings['toolbarMenuEnable'] ) { // Do custom shortcodes from preset. GroovyMenuActions::check_toolbar_menu( $styles ); } if ( in_array( $header_style, [ 1, 2 ], true ) ) { // Do custom shortcodes from preset. GroovyMenuActions::check_menu_block_for_actions( $styles ); } } if ( method_exists( 'GroovyMenuUtils', 'enquare_styles_recompile' ) ) { GroovyMenuUtils::enquare_styles_recompile( $compiled_css, $groovyMenuSettings['version'] ); } /** * Google Font link building */ if ( ! empty( $groovyMenuSettings['googleFont'] ) && 'none' !== $groovyMenuSettings['googleFont'] ) { $common_font_family = rawurlencode( $groovyMenuSettings['googleFont'] ); $common_font_variants = []; $common_font_subsets = []; if ( ! empty( $groovyMenuSettings['itemTextWeight'] ) && 'none' !== $groovyMenuSettings['itemTextWeight'] ) { array_push( $common_font_variants, $groovyMenuSettings['itemTextWeight'] ); } if ( ! empty( $groovyMenuSettings['mobileItemTextWeight'] ) && 'none' !== $groovyMenuSettings['mobileItemTextWeight'] ) { array_push( $common_font_variants, $groovyMenuSettings['mobileItemTextWeight'] ); } if ( ! empty( $groovyMenuSettings['mobileSubitemTextWeight'] ) && 'none' !== $groovyMenuSettings['mobileSubitemTextWeight'] ) { array_push( $common_font_variants, $groovyMenuSettings['mobileSubitemTextWeight'] ); } if ( ! empty( $groovyMenuSettings['subLevelItemTextWeight'] ) && 'none' !== $groovyMenuSettings['subLevelItemTextWeight'] ) { array_push( $common_font_variants, $groovyMenuSettings['subLevelItemTextWeight'] ); } if ( ! empty( $groovyMenuSettings['megamenuTitleTextWeight'] ) && 'none' !== $groovyMenuSettings['megamenuTitleTextWeight'] ) { array_push( $common_font_variants, $groovyMenuSettings['megamenuTitleTextWeight'] ); } if ( ! empty( $common_font_variants ) ) { $uniq_common_fonts_variants = array_unique( $common_font_variants ); $common_font_family = $common_font_family . ':' . implode( ',', $uniq_common_fonts_variants ); } if ( ! empty( $groovyMenuSettings['itemTextSubset'] ) && 'none' !== $groovyMenuSettings['itemTextSubset'] ) { array_push( $common_font_subsets, $groovyMenuSettings['itemTextSubset'] ); } if ( ! empty( $groovyMenuSettings['subLevelItemTextSubset'] ) && 'none' !== $groovyMenuSettings['subLevelItemTextSubset'] ) { array_push( $common_font_subsets, $groovyMenuSettings['subLevelItemTextSubset'] ); } if ( ! empty( $groovyMenuSettings['megamenuTitleTextSubset'] ) && 'none' !== $groovyMenuSettings['megamenuTitleTextSubset'] ) { array_push( $common_font_subsets, $groovyMenuSettings['megamenuTitleTextSubset'] ); } if ( ! empty( $common_font_variants ) && ! empty( $common_font_subsets ) ) { $uniq_common_fonts_subsets = array_unique( $common_font_subsets ); $common_font_family = $common_font_family . '&subset=' . implode( ',', $uniq_common_fonts_subsets ); } $output_html .= groovy_menu_add_gfonts_fontface( $preset_id, 'google_font', $common_font_family, ( ! $args['gm_echo'] ) ); } if ( ! empty( $groovyMenuSettings['logoTxtFont'] ) && 'none' !== $groovyMenuSettings['logoTxtFont'] && 'text' === $groovyMenuSettings['logoType'] ) { $logo_font_family = rawurlencode( $groovyMenuSettings['logoTxtFont'] ); $logo_font_variants = []; $logo_font_subsets = []; if ( ! empty( $groovyMenuSettings['logoTxtWeight'] ) && 'none' !== $groovyMenuSettings['logoTxtWeight'] ) { array_push( $logo_font_variants, $groovyMenuSettings['logoTxtWeight'] ); } if ( ! empty( $groovyMenuSettings['stickyLogoTxtWeight'] ) && 'none' !== $groovyMenuSettings['stickyLogoTxtWeight'] ) { array_push( $logo_font_variants, $groovyMenuSettings['stickyLogoTxtWeight'] ); } if ( ! empty( $logo_font_variants ) ) { $uniq_logo_fonts_variants = array_unique( $logo_font_variants ); $logo_font_family = $logo_font_family . ':' . implode( ',', $uniq_logo_fonts_variants ); } if ( ! empty( $groovyMenuSettings['logoTxtSubset'] ) && 'none' !== $groovyMenuSettings['logoTxtSubset'] ) { array_push( $logo_font_subsets, $groovyMenuSettings['logoTxtSubset'] ); } if ( ! empty( $groovyMenuSettings['stickyLogoTxtSubset'] ) && 'none' !== $groovyMenuSettings['stickyLogoTxtSubset'] ) { array_push( $logo_font_subsets, $groovyMenuSettings['stickyLogoTxtSubset'] ); } if ( ! empty( $logo_font_variants ) && ! empty( $logo_font_subsets ) ) { $uniq_logo_fonts_subsets = array_unique( $logo_font_subsets ); $logo_font_family = $logo_font_family . '&subset=' . implode( ',', $uniq_logo_fonts_subsets ); } $output_html .= groovy_menu_add_gfonts_fontface( $preset_id, 'logo_txt_font', $logo_font_family, ( ! $args['gm_echo'] ) ); } if ( ! empty( $groovyMenuSettings['toolbarMenuTextFont'] ) && 'none' !== $groovyMenuSettings['toolbarMenuTextFont'] && $groovyMenuSettings['toolbarMenuEnable'] ) { $toolbar_menu_font_family = rawurlencode( $groovyMenuSettings['toolbarMenuTextFont'] ); $toolbar_menu_font_variants = []; $toolbar_menu_font_subsets = []; if ( ! empty( $groovyMenuSettings['toolbarMenuTextWeight'] ) && 'none' !== $groovyMenuSettings['toolbarMenuTextWeight'] ) { array_push( $toolbar_menu_font_variants, $groovyMenuSettings['toolbarMenuTextWeight'] ); } if ( ! empty( $toolbar_menu_font_variants ) ) { $uniq_toolbar_menu_fonts_variants = array_unique( $toolbar_menu_font_variants ); $toolbar_menu_font_family = $toolbar_menu_font_family . ':' . implode( ',', $uniq_toolbar_menu_fonts_variants ); } if ( ! empty( $groovyMenuSettings['toolbarMenuTextSubset'] ) && 'none' !== $groovyMenuSettings['toolbarMenuTextSubset'] ) { array_push( $toolbar_menu_font_subsets, $groovyMenuSettings['toolbarMenuTextSubset'] ); } if ( ! empty( $toolbar_menu_font_variants ) && ! empty( $toolbar_menu_font_subsets ) ) { $uniq_toolbar_menu_fonts_subsets = array_unique( $toolbar_menu_font_subsets ); $toolbar_menu_font_family = $toolbar_menu_font_family . '&subset=' . implode( ',', $uniq_toolbar_menu_fonts_subsets ); } $output_html .= groovy_menu_add_gfonts_fontface( $preset_id, 'toolbar_menu_txt_font', $toolbar_menu_font_family, ( ! $args['gm_echo'] ) ); } $uniqid = empty( $groovyMenuSettings['gm-uniqid'][ $args['gm_preset_id'] ] ) ? 'gm-' . uniqid() : $groovyMenuSettings['gm-uniqid'][ $args['gm_preset_id'] ]; if ( $args['gm_echo'] ) { $output_html .= groovy_menu_js_request( $uniqid, true ); } else { groovy_menu_js_request( $uniqid ); } if ( ! $groovyMenuPreview ) { $css_file_params = array( 'upload_dir' => GroovyMenuUtils::getUploadDir(), 'upload_uri' => GroovyMenuUtils::getUploadUri(), 'css_filename' => 'preset_' . $preset_id . ( is_rtl() ? '_rtl' : '' ) . '.css', 'preset_id' => strval( $preset_id ), 'preset_key' => empty( $groovyMenuSettings['presetKey'] ) ? GROOVY_MENU_VERSION : $groovyMenuSettings['presetKey'], ); $groovyMenuSettings['css_file_params'] = $css_file_params; $output_html .= groovy_menu_add_preset_style( $preset_id, $compiled_css, $args['gm_echo'] ); // Custom CSS & JS. $custom_css = trim( stripslashes( $styles->get( 'general', 'css' ) ) ); $custom_js = trim( stripslashes( $styles->get( 'general', 'js' ) ) ); if ( $custom_css ) { $tag_name = 'style'; $output_html .= "\n" . '<' . esc_attr( $tag_name ) . '>' . $custom_css . ''; } if ( $custom_js ) { $tag_name = 'script'; $output_html .= "\n" . '<' . esc_attr( $tag_name ) . '>' . $custom_js . ''; } } $wrapper_tag = 'header'; if ( $groovyMenuSettings['wrapperTag'] !== $wrapper_tag ) { $wrapper_tag = esc_attr( $groovyMenuSettings['wrapperTag'] ); } if ( isset( $groovyMenuSettings['mobileNavMenu'] ) && 'none' === $groovyMenuSettings['mobileNavMenu'] ) { $show_mobile_menu = false; } $searchForm = $groovyMenuSettings['searchForm']; $menu_button_text = $styles->getGlobal( 'misc_icons', 'menu_button_text' ); $menu_button_text = apply_filters( 'wpml_translate_single_string', $menu_button_text, 'groovy-menu', 'Global settings - Menu button text' ); // prepare for Second sidebar hamburger html. $second_sidebar_burger = array( 'main_bar_left' => '', 'main_bar_right' => '', 'main_bar_before_logo' => '', 'main_bar_after_logo' => '', 'main_bar_before_main_menu' => '', 'main_bar_after_main_menu' => '', 'main_bar_before_action_button' => '', ); if ( 1 === $header_style && $groovyMenuSettings['secondSidebarMenuEnable'] && ! empty( $groovyMenuSettings['secondSidebarMenuSideIconPosition'] ) && isset( $second_sidebar_burger[ $groovyMenuSettings['secondSidebarMenuSideIconPosition'] ] ) ) { $menu_second_button_text_full = ''; if ( $groovyMenuSettings['secondSidebarMenuButtonShowText'] ) { $menu_second_button_text_full = '' . $menu_button_text . ''; } $second_sidebar_burger_html = '
' . $menu_second_button_text_full . '
'; $second_sidebar_burger[ $groovyMenuSettings['secondSidebarMenuSideIconPosition'] ] = $second_sidebar_burger_html; } // Clean output, first level --------------------------------------------------------------------------------------. ob_start(); ob_start(); /** * Fires before the groovy menu output. * * @since 1.2.20 */ do_action( 'gm_before_main_header' ); $output_html .= ob_get_clean(); $output_html .= ' <' . esc_html( $wrapper_tag ) . ' class="gm-navbar gm-preset-id-' . esc_attr( $preset_id ) . esc_attr( $additional_html_class ) . '" id="' . esc_attr( $uniqid ) . '" data-version="' . esc_attr( GROOVY_MENU_VERSION ) . '">
'; if ( 'true' === $groovyMenuSettings['header']['toolbar'] ) { $socials = array( 'twitter', 'facebook', 'google', 'vimeo', 'dribbble', 'pinterest', 'youtube', 'linkedin', 'instagram', 'flickr', 'vk', ); $toolbar_email = ''; if ( ! empty( $styles->getGlobal( 'toolbar', 'toolbar_email' ) ) ) { $toolbar_email = $styles->getGlobal( 'toolbar', 'toolbar_email' ); $toolbar_email = apply_filters( 'wpml_translate_single_string', $toolbar_email, 'groovy-menu', 'Global settings - toolbar email text' ); } $toolbar_phone = ''; if ( ! empty( $styles->getGlobal( 'toolbar', 'toolbar_phone' ) ) ) { $toolbar_phone = $styles->getGlobal( 'toolbar', 'toolbar_phone' ); $toolbar_phone = apply_filters( 'wpml_translate_single_string', $toolbar_phone, 'groovy-menu', 'Global settings - toolbar phone text' ); } $toolbar_type = isset( $groovyMenuSettings['toolbarType'] ) ? $groovyMenuSettings['toolbarType'] : 'default'; $toolbar_custom_id = isset( $groovyMenuSettings['toolbarCustomId'] ) ? intval( $groovyMenuSettings['toolbarCustomId'] ) : 0; $output_html .= '
'; if ( 'menublock' === $toolbar_type && ! empty( $toolbar_custom_id ) ) { $menu_block_helper = new \GroovyMenu\WalkerNavMenu(); $menu_block_content = $menu_block_helper->getMenuBlockPostContent( $toolbar_custom_id ); if ( function_exists( 'groovy_menu_add_custom_styles' ) ) { groovy_menu_add_custom_styles( $toolbar_custom_id ); } if ( function_exists( 'groovy_menu_add_custom_styles_support' ) ) { groovy_menu_add_custom_styles_support( $toolbar_custom_id ); } $output_html .= '
'; $output_html .= $menu_block_content; } else { $output_html .= '
'; $output_html .= '
'; ob_start(); /** * Fires at the toolbar left as first element output. * * @since 1.8.18 */ do_action( 'gm_toolbar_left_first' ); $output_html .= ob_get_clean(); $output_html .= '
'; if ( ! empty( $toolbar_email ) ) { $output_html .= ''; if ( $styles->getGlobal( 'toolbar', 'toolbar_email_icon' ) ) { $output_html .= ''; } $output_html .= ''; if ( $styles->getGlobal( 'toolbar', 'toolbar_email_as_link' ) ) { $output_html .= '' . esc_attr( $styles->getGlobal( 'toolbar', 'toolbar_email' ) ) . ''; } else { $output_html .= esc_attr( $toolbar_email ); } $output_html .= ''; $output_html .= ''; } if ( ! empty( $toolbar_phone ) ) { $output_html .= ''; if ( $styles->getGlobal( 'toolbar', 'toolbar_phone_icon' ) ) { $output_html .= ''; } $output_html .= ''; if ( $styles->getGlobal( 'toolbar', 'toolbar_phone_as_link' ) ) { $output_html .= '' . esc_attr( $toolbar_phone ) . ''; } else { $output_html .= esc_attr( $toolbar_phone ); } $output_html .= ''; $output_html .= ''; } $output_html .= '
'; ob_start(); /** * Fires at the toolbar left as last element output. * * @since 1.8.18 */ do_action( 'gm_toolbar_left_last' ); $output_html .= ob_get_clean(); $output_html .= '
'; // .gm-toolbar-left $output_html .= '
'; ob_start(); /** * Fires at the toolbar right as first element output. * * @since 1.8.18 */ do_action( 'gm_toolbar_right_first' ); $output_html .= ob_get_clean(); $output_html .= ''; if ( $groovyMenuSettings['showWpml'] ) { ob_start(); do_action( 'wpml_add_language_selector' ); $output_html .= ob_get_clean(); } ob_start(); /** * Fires at the toolbar right as last element output. * * @since 1.8.18 */ do_action( 'gm_toolbar_right_last' ); $output_html .= ob_get_clean(); $output_html .= '
'; // .gm-toolbar-right } $output_html .= '
'; // .gm-container $output_html .= '
'; // #gm-toolbar.gm-toolbar } $output_html .= '
'; if ( 5 === $header_style ) { $output_html .= '
'; } $output_html .= GroovyMenuUtils::clean_output( $second_sidebar_burger['main_bar_left'] ); $output_html .= ''; $mobile_woo_icon_html = ''; $mobile_search_icon_html = ''; // Woocomerce minicart for mobile top bar & minimalistic. if ( ! gm_get_shop_is_catalog() && $groovyMenuSettings['woocommerceCart'] && class_exists( 'WooCommerce' ) && function_exists( 'wc_get_page_id' ) && ( ( ! empty( $groovyMenuSettings['woocommerceIconPositionMobile'] ) && in_array( $groovyMenuSettings['woocommerceIconPositionMobile'], array( 'topbar', 'topbar_slideBottom', ), true ) ) || ( 2 === $header_style && ! empty( $groovyMenuSettings['minimalisticMenuWooIconPosition'] ) && in_array( $groovyMenuSettings['minimalisticMenuWooIconPosition'], array( 'topbar', 'topbar_slideBottom', ), true ) ) ) ) { global $woocommerce; $qty = 0; if ( $woocommerce && isset( $woocommerce->cart ) ) { $qty = $woocommerce->cart->get_cart_contents_count(); } $cartIcon = 'gmi gmi-bag'; if ( $styles->getGlobal( 'misc_icons', 'cart_icon' ) ) { $cartIcon = $styles->getGlobal( 'misc_icons', 'cart_icon' ); } $mobile_woo_icon_html .= ' '; } // Search icon for mobile top bar & minimalistic. if ( 'disable' !== $searchForm && ( ( ! empty( $groovyMenuSettings['searchFormIconPositionMobile'] ) && in_array( $groovyMenuSettings['searchFormIconPositionMobile'], array( 'topbar', 'topbar_slideBottom', ), true ) ) || ( 2 === $header_style && ! empty( $groovyMenuSettings['minimalisticMenuSearchIconPosition'] ) && in_array( $groovyMenuSettings['minimalisticMenuSearchIconPosition'], array( 'topbar', 'topbar_slideBottom', ), true ) ) ) ) { $searchIcon = 'gmi gmi-zoom-search'; if ( $styles->getGlobal( 'misc_icons', 'search_icon' ) ) { $searchIcon = $styles->getGlobal( 'misc_icons', 'search_icon' ); } $isFullScreen = false; $isSearchCustom = false; if ( 'custom' === $searchForm ) { $isSearchCustom = true; } $searchFormCustomWrapper = isset( $groovyMenuSettings['searchFormCustomWrapper'] ) ? $groovyMenuSettings['searchFormCustomWrapper'] : 'fullscreen'; if ( 'fullscreen' === $searchForm || ( $isSearchCustom && 'dropdown' !== $searchFormCustomWrapper ) ) { $isFullScreen = 'fullscreen'; } ob_start(); /** * Fires before groovy menu mobile search icon. * * @since 2.2.0 */ do_action( 'gm_mobile_before_search_icon' ); $mobile_search_icon_html .= ob_get_clean(); $mobile_search_icon_html .= ''; } ob_start(); /** * Fires as first groovy menu action buttons. * * @since 2.2.0 */ do_action( 'gm_main_menu_actions_button_first' ); $gm_main_menu_actions_button_first = ob_get_clean(); ob_start(); /** * Fires as last groovy menu action buttons. * * @since 2.2.0 */ do_action( 'gm_main_menu_actions_button_last' ); $gm_main_menu_actions_button_last = ob_get_clean(); if ( ! empty( $mobile_woo_icon_html ) || ! empty( $mobile_search_icon_html ) || ! empty( $gm_main_menu_actions_button_first ) || ! empty( $gm_main_menu_actions_button_last ) ) { $output_html .= '
' . $gm_main_menu_actions_button_first . $mobile_search_icon_html . $mobile_woo_icon_html . $gm_main_menu_actions_button_last . '
'; } if ( $groovyMenuSettings['mobileCustomHamburger'] ) { if ( $groovyMenuSettings['mobileCustomHamburger'] ) { ob_start(); /** * Fires for custom mobile hamburger. * * @since 2.4.11 */ do_action( 'gm_custom_mobile_hamburger' ); $output_html .= ob_get_clean(); } } else { ob_start(); /** * Fires before mobile hamburger. * * @since 2.4.11 */ do_action( 'gm_before_mobile_hamburger' ); $output_html .= ob_get_clean(); $menu_button_text_full = ''; $menu_second_button_text_full = ''; if ( $groovyMenuSettings['mobileMenuButtonShowText'] || 2 === $header_style ) { $menu_button_text_full = '' . $menu_button_text . ''; } if ( 2 === $header_style && $groovyMenuSettings['minimalisticCssHamburger'] ) { $output_html .= '
' . $menu_button_text_full . '
'; } elseif ( 2 !== $header_style && $groovyMenuSettings['mobileIndependentCssHamburger'] ) { $output_html .= '
' . $menu_button_text_full . '
'; } else { $output_html .= ''; $output_html .= $menu_button_text_full; $output_html .= ' '; $menu_icon = 'fa fa-bars'; if ( ! empty( $styles->getGlobal( 'misc_icons', 'menu_icon' ) ) ) { $menu_icon = $styles->getGlobal( 'misc_icons', 'menu_icon' ); } $output_html .= ' '; $output_html .= ' '; $output_html .= ''; } ob_start(); /** * Fires after mobile hamburger. * * @since 2.4.11 */ do_action( 'gm_after_mobile_hamburger' ); $output_html .= ob_get_clean(); } ob_start(); /** * Fires before the groovy main menu wrapper. * * @since 2.2.0 */ do_action( 'gm_before_main_menu_nav' ); $output_html .= ob_get_clean(); $output_html .= '
'; if ( 2 === $header_style && $groovyMenuSettings['minimalisticMenuFullscreen'] && ! $groovyMenuSettings['minimalisticMenuShowCloseButton'] ) { $output_html .= ' '; } if ( 2 === $header_style && $groovyMenuSettings['minimalisticMenuShowCloseButton'] ) { $output_html .= '
'; if ( $groovyMenuSettings['minimalisticCssHamburger'] ) { $output_html .= '
'; } else { $output_html .= ''; $output_html .= ' '; $menu_icon = 'fa fa-bars'; if ( ! empty( $styles->getGlobal( 'misc_icons', 'close_icon' ) ) ) { $menu_icon = $styles->getGlobal( 'misc_icons', 'close_icon' ); } $output_html .= ' '; $output_html .= ' '; $output_html .= ''; } $output_html .= '
'; } $output_html .= ''; ob_start(); /** * Fires after main menu nav. * * @since 1.9.5 */ do_action( 'gm_after_main_menu_nav' ); $output_html .= ob_get_clean(); $show_gm_action = false; $expand_space = false; if ( 'disable' !== $searchForm ) { $show_gm_action = true; } if ( ! gm_get_shop_is_catalog() && $groovyMenuSettings['woocommerceCart'] && class_exists( 'WooCommerce' ) ) { $show_gm_action = true; } if ( in_array( $header_style, [ 3, 5 ], true ) && ! $show_gm_action ) { $show_gm_action = true; $expand_space = true; } if ( $show_gm_action ) { $output_html .= '
'; $output_html .= $gm_main_menu_actions_button_first; $output_html .= GroovyMenuUtils::clean_output( $second_sidebar_burger['main_bar_before_action_button'] ); if ( $styles->get( 'general', 'show_divider' ) ) { if ( 1 === $header_style ) { $output_html .= ''; } } if ( 'disable' !== $searchForm ) { $searchIcon = 'gmi gmi-zoom-search'; if ( $styles->getGlobal( 'misc_icons', 'search_icon' ) ) { $searchIcon = $styles->getGlobal( 'misc_icons', 'search_icon' ); } if ( method_exists( 'GroovyMenuUtils', 'getSearchBlock' ) ) { $output_html .= GroovyMenuUtils::getSearchBlock( $searchIcon ); } } if ( ! gm_get_shop_is_catalog() && $groovyMenuSettings['woocommerceCart'] && class_exists( 'WooCommerce' ) && function_exists( 'wc_get_page_id' ) ) { global $woocommerce; $qty = 0; if ( $woocommerce && isset( $woocommerce->cart ) ) { $qty = $woocommerce->cart->get_cart_contents_count(); } $cartIcon = 'gmi gmi-bag'; if ( $styles->getGlobal( 'misc_icons', 'cart_icon' ) ) { $cartIcon = $styles->getGlobal( 'misc_icons', 'cart_icon' ); } $woo_cart_dropdown = $groovyMenuSettings['wooCartDisableDropdown'] ? '' : ' gm-dropdown'; $output_html .= '
'; $output_html .= '
' . esc_html__( 'My cart', 'groovy-menu' ) . '' . groovy_menu_woocommerce_mini_cart_counter( $qty ) . '
'; $output_html .= '
'; if ( $woocommerce && isset( $woocommerce->cart ) ) { ob_start(); $template_mini_cart_path = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, get_stylesheet_directory() . '/woocommerce/cart/mini-cart.php' ); if ( file_exists( $template_mini_cart_path ) && is_file( $template_mini_cart_path ) ) { include $template_mini_cart_path; } elseif ( defined( 'WC_PLUGIN_FILE' ) ) { $original_mini_cart_path = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, dirname( WC_PLUGIN_FILE ) . '/templates/cart/mini-cart.php' ); if ( file_exists( $original_mini_cart_path ) && is_file( $original_mini_cart_path ) ) { $args['list_class'] = ''; include $original_mini_cart_path; } } $output_html .= ob_get_clean(); } $output_html .= '
'; } $output_html .= $gm_main_menu_actions_button_last; if ( $expand_space ) { $output_html .= '
'; } $output_html .= '
'; } elseif ( ! empty( $gm_main_menu_actions_button_first ) || ! empty( $gm_main_menu_actions_button_last ) ) { $output_html .= '
'; $output_html .= $gm_main_menu_actions_button_first; $output_html .= $gm_main_menu_actions_button_last; $output_html .= '
'; } $output_html .= GroovyMenuUtils::clean_output( $second_sidebar_burger['main_bar_right'] ); $output_html .= '
'; // ---------------------------------------------------------------------------- second_sidebar_menu_enable --------. if ( 1 === $header_style && $groovyMenuSettings['secondSidebarMenuEnable'] ) { $second_css_classes = $styles->getHtmlClassesSecondSidebarMenu(); $output_html .= '
'; ob_start(); /** * Fires at the Top of Second Sidebar Menu. * * @since 2.5.0 */ do_action( 'gm_second_sidebar_menu_top' ); $output_html .= ob_get_clean(); if ( isset( $groovyMenuSettings['secondSidebarMenuId'] ) && is_numeric( $groovyMenuSettings['secondSidebarMenuId'] ) ) { // Re-assign nav_menu for the Second Sidebar Menu. $args['menu'] = intval( $groovyMenuSettings['secondSidebarMenuId'] ); // Second Sidebar Menu wrapper. $output_html .= '
'; ob_start(); /** * Fires at the Second Sidebar Menu nav. * * @since 2.5.0 */ do_action( 'gm_second_sidebar_menu_nav_first' ); $output_html .= ob_get_clean(); $output_html .= wp_nav_menu( $args ); ob_start(); /** * Fires at the Second Sidebar Menu nav. * * @since 2.5.0 */ do_action( 'gm_second_sidebar_menu_nav_last' ); $output_html .= ob_get_clean(); $output_html .= '
'; // .gm-mobile-menu-container $output_html .= '
'; } ob_start(); /** * Fires at the Bottom of Second Sidebar Menu. * * @since 2.5.0 */ do_action( 'gm_second_sidebar_menu_bottom' ); $output_html .= ob_get_clean(); $output_html .= '
'; } // ------------------------------------------------------------------------------------------- mobile menu --------. if ( $show_mobile_menu ) { $custom_css_class = $styles->getCustomHtmlClass(); $output_html .= ''; } // end of if $show_mobile_menu. if ( $groovyMenuSettings['dropdownOverlay'] ) { $output_html .= '
'; } ob_start(); /** * Fires after the groovy menu output. * * @since 1.2.20 */ do_action( 'gm_after_main_header' ); $output_html .= ob_get_clean(); // Required if the action returns unexpected content. // Clean output. $final = ob_get_clean(); if ( $args['gm_echo'] ) { echo ( ! empty( $output_html ) ) ? $output_html : ''; } else { return $output_html; } return ''; } /** * Alias for function groovyMenu(). Displays a navigation menu. * * @param array $args { * Optional. Array of nav menu arguments. * * @type int|string|WP_Term $menu Desired menu. Accepts (matching in order) id, slug, name, menu object. Default empty. * @type string $menu_class CSS class to use for the ul element which forms the menu.Default is 'gm-navbar-nav' * @type string $gm_preset_id Groovy menu preset id. * @type bool $echo Whether to echo the menu or return it. Default true. * @type int $depth How many levels of the hierarchy are to be included. 0 means all. Default 0. * @type string $theme_location Theme location to be used. Must be registered with register_nav_menu() * in order to be selectable by the user. * * @return string if $echo is true then return empty string (by default) * */ function gm_wp_nav_menu( $args = array() ) { global $groovyMenuSettings; if ( ! empty( $args['menu'] ) || ! empty( $args['gm_preset_id'] ) ) { \GroovyMenu\PreStorage::get_instance()->remove_all_gm(); } $defaults_args = array( 'menu' => 'default', 'gm_preset_id' => 'default', 'echo' => false, 'gm_echo' => true, 'gm_pre_storage' => false, 'depth' => 0, // limit the depth of the nav. 'is_disable' => false, ); $args = shortcode_atts( $defaults_args, $args, '' ); if ( ! empty( $args['gm_preset_id'] ) ) { $groovyMenuSettings['preset']['id'] = $args['gm_preset_id']; } return groovyMenu( $args ); } /** * Alias for function groovyMenu(). Displays a navigation menu. * * @param array $args { * Optional. Array of nav menu arguments. * * @type int|string|WP_Term $menu Desired menu. Accepts (matching in order) id, slug, name, menu object. Default empty. * @type string $menu_class CSS class to use for the ul element which forms the menu.Default is 'gm-navbar-nav' * @type string $gm_preset_id Groovy menu preset id. * @type bool $echo Whether to echo the menu or return it. Default true. * @type int $depth How many levels of the hierarchy are to be included. 0 means all. Default 0. * @type string $theme_location Theme location to be used. Must be registered with register_nav_menu() * in order to be selectable by the user. * * @return string if $echo is true then return empty string (by default) * */ function groovy_menu( $args = array() ) { return groovyMenu( $args ); } add_shortcode( 'groovy_menu', 'groovyMenu' );