0

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');
});
  • 1
    The location is /wp-includes/widgets/class-wp-nav-menu-widget.php. – Frank P. Walentynowicz Apr 28 '17 at 4:54
1

You will find the source of Custom Menu widget in /wp-includes/widgets/class-wp-nav-menu-widget.php.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.