wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_widgets_add_menu › WordPress Function
Since2.2.0
Deprecatedn/a
› wp_widgets_add_menu ( No parameters )
Defined at: |
|
Codex: | |
Change Log: |
|
Appends the Widgets menu to the themes main menu.
Related Functions: wp_get_nav_menus, wp_widgets_init, wp_delete_nav_menu, wp_get_nav_menu_name, wp_page_menu
Source
function wp_widgets_add_menu() { global $submenu; if ( ! current_theme_supports( 'widgets' ) ) { return; } $menu_name = __( 'Widgets' ); if ( wp_is_block_theme() ) { $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); } else { $submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); } ksort( $submenu['themes.php'], SORT_NUMERIC ); }