I am a novice in WordPress theme development. I am trying to build a custom Code menu widget for the footer, which is totally different from the default menu widget provided by the WordPress, but I could not understand from where to start. The best will be If I can find the default widget created by the WordPress. I can get some clue and move on.
I have created this with the help of some videos on YouTube →
class chimp_footer_menu extends WP_Widget {
function construct() {
//Create Widget
parent::__construct(
'footer_menu_widget',
__('The Footer menu Widget','text_domain'),
array( 'description' => __('A Footer Menu Widget', 'text_domain' )));
}
// Front End display
public function widget($args, $instance) {
}
// Backend Form
public function form($instance) {
if (isset ($instance['title'])) {
$title = $instance['title'];
}
else {
$title = __('New Title','text_domain');
}
}
// Update Widget Values
public function update($new_instance, $old_instance) {}
}
add_action('widgets_init', function(){
register_widget('chimp_footer_menu');
});