PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
core
/
admin
/
header-builder
/
includes
/
fields
<?php /** * Header Builder - Menu Field. * * @author Webnus */ // don't load directly. if ( ! defined( 'ABSPATH' ) ) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } /** * Menu field function. * * @since 1.0.0 */ function whb_menu( $settings ) { $title = isset( $settings['title'] ) ? $settings['title'] : ''; $id = isset( $settings['id'] ) ? $settings['id'] : ''; $menus = wp_get_nav_menus(); $option = ''; $counter = -1; if (function_exists('icl_get_languages')) { $languages = icl_get_languages(); foreach ($languages as $lang) { $option = ''; $counter++; $output .= '<h5>'.__('Language').' '.$counter.'</h5>'; $output .= '<div style="border:1px solid #dedede;margin:5px;padding:5px;border-radius:2px;">'; if ( ! empty( $languages ) ) : $option .= '<select class="whb-field-input whb-field-select whb-field-language-'.$counter.'" data-field-name="menu-lang-'.$counter.'">'; foreach ( $languages as $item ) : $option .= '<option value="' . esc_attr( $item['language_code'] ) . '">' . esc_html( $item['native_name'] ) . '</option>'; endforeach; $option .= '</select>'; else : $option .= '<span class="whb-field-input whb-field-select whb-field-language-'.$counter.'" data-field-name="menu-lang-'.$counter.'">' . esc_html__( 'No items of this type were found.', 'deep' ) . '</span>'; endif; $output .= ' <div class="whb-field w-col-sm-12"> <h5>' . __('Select a Language') . '</h5> <div class="whb-dropdown"> ' . $option . ' </div> </div> '; $option = ''; if ( ! empty( $menus ) ) : $option .= '<select class="whb-field-input whb-field-select whb-field-menu-'.counter.'" data-field-name="menu-menu-'.$counter . '">'; foreach ( $menus as $item ) : $option .= '<option value="' . esc_attr( $item->term_id ) . '">' . esc_html( $item->name ) . '</option>'; endforeach; $option .= '</select>'; else : $option .= '<span class="whb-field-input whb-field-select whb-field-menu-'.counter.'" data-field-name="menu-menu-'.$counter.'">' . esc_html__( 'No items of this type were found.', 'deep' ) . '</span>'; endif; $output .= ' <div class="whb-field w-col-sm-12"> <h5>' . $title . '</h5> <div class="whb-dropdown"> ' . $option . ' </div> </div> '; $output .= '<div style="clear:both"></div>'; $output .= '</div>'; } } else{ if ( ! empty( $menus ) ) : $option .= '<select class="whb-field-input whb-field-select whb-field-menu" data-field-name="' . esc_attr( $id ) . '">'; foreach ( $menus as $item ) : $option .= '<option value="' . esc_attr( $item->term_id ) . '">' . esc_html( $item->name ) . '</option>'; endforeach; $option .= '</select>'; else : $option .= '<span class="whb-field-input whb-field-select whb-field-menu" data-field-name="' . esc_attr( $id ) . '">' . esc_html__( 'No items of this type were found.', 'deep' ) . '</span>'; endif; $output = ' <div class="whb-field w-col-sm-12"> <h5>' . $title . '</h5> <div class="whb-dropdown"> ' . $option . ' </div> </div> '; } if ( ! isset( $settings['get'] ) ) : echo '' . $output; else : return $output; endif; }
[+]
..
[-] whb-text-field.php
[edit]
[-] whb-imageselect-field.php
[edit]
[-] whb-hidden-field.php
[edit]
[+]
icons
[-] whb-image-field.php
[edit]
[-] whb-colorpicker-field.php
[edit]
[-] whb-custom-select-field.php
[edit]
[-] whb-select-field.php
[edit]
[-] whb-menu-field.php
[edit]
[+]
styling-tab
[-] whb-switcher-field.php
[edit]
[-] whb-help-field.php
[edit]
[-] whb-textarea-field.php
[edit]
[-] whb-icon-field.php
[edit]
[-] whb-number-unit-field.php
[edit]
[-] whb-contact-field.php
[edit]