WP_Nav_Menu_Widget::__construct() WordPress Method
The WP_Nav_Menu_Widget::__construct() method is used to initialize the widget class. It takes two arguments: an id and a name. The id is used to uniquely identify the widget, while the name is used to display the widget name in the admin interface.
WP_Nav_Menu_Widget::__construct() #
Sets up a new Navigation Menu widget instance.
Source
File: wp-includes/widgets/class-wp-nav-menu-widget.php
public function __construct() {
$widget_ops = array(
'description' => __( 'Add a navigation menu to your sidebar.' ),
'customize_selective_refresh' => true,
'show_instance_in_rest' => true,
);
parent::__construct( 'nav_menu', __( 'Navigation Menu' ), $widget_ops );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |