'widget-navigation widget_navigation_menu',
'description' => __( 'Display Custom Footer Navigation Menu.', 'becommerce-store' )
);
// Create the widget.
parent::__construct(
'custom_nav_menu', // $this->id_base
__( '» Becommerce Footer Navigation Menu', 'becommerce-store' ), // $this->name
$becommerce_store_widget_options // $this->becommerce_store_widget_options
);
}
/**
* Outputs the widget based on the arguments input through the widget controls.
*
* @since 1.0.0
*/
function widget( $args, $instance ) {
extract( $args );
echo '
';
// Output the theme's $before_widget wrapper.
echo $before_widget;
$instance = wp_parse_args( $instance, array(
'title' => '',
'select_menu' => '',
) );
echo $before_title;
echo empty( $instance['title'] ) ? _e( 'Quick Links', 'becommerce-store' ) : apply_filters( 'widget_title', $instance['title'] );
echo $after_title;
if (has_nav_menu($instance['select_menu'])) {
wp_nav_menu( array(
'theme_location' => $instance['select_menu'],
'menu_class' => "widget_nav_menu",
'menu_id' => "",
));
}
?>
';
}
/**
* Updates the widget control options for the particular instance of the widget.
*
* @since 1.0.0
*/
function update( $new_instance, $old_instance ) {
//$instance = array();
$new_instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( strip_tags( $new_instance['title'] ) ): '';
return $new_instance;
// return $instance;
}
/**
* Displays the widget control options in the Widgets admin screen.
*
* @since 1.0.0
*/
function form( $instance ) {
// Default value.
$instance = wp_parse_args( $instance, array(
'title' => '',
'select_menu' => '',
) );
$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
?>