',
$this->get_field_id( 'title' ),
esc_html__('Title','ac-repair'),
$this->get_field_name( 'title' ),
esc_attr( $title )
);
$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
$nav_menu = esc_html( $nav_menu );
$option_key = '';
foreach ( $GLOBALS['fixit_wordpress_menus'] as $key => $value) {
$option_key .= '';
}
printf(
'
',
$this->get_field_id( 'nav_menu' ),
esc_html__('Choose your Menu in Footer Section','ac-repair'),
$this->get_field_name( 'nav_menu' ),
$option_key
);
}
/**
* Renders the output.
*
* @see WP_Widget::widget()
*/
public function widget( $args, $instance ){ // Widget output
extract($args);
$title = ($instance['title']) ? $instance['title'] : esc_html__('Fixit -- Footer Useful Link', 'ac-repair');
$nav_menu = ($instance['nav_menu']) ? $instance['nav_menu'] : esc_html__('Please Select Menu', 'ac-repair');
print $before_widget
. ''
. $after_widget ;
}
/**
* Prepares the content. Not.
*
* @param array $new_instance New content
* @param array $old_instance Old content
* @return array New content
*/
public function update( $new_instance, $old_instance ){
$new_instance_array = array( 'title', 'nav_menu' );
foreach( $new_instance_array as $val )
$old_instance[ $val ] = $new_instance[ $val ];
return $old_instance;
}
/**
* Tell WP we want to use this widget.
*
* @wp-hook widgets_init
* @return void
*/
public static function register(){
register_widget( __CLASS__ );
}
}