Don't show Appearance > Widgets if the theme has no sidebars defined. props SergeyBiryukov for the initial patch. fixes #21761.

git-svn-id: http://core.svn.wordpress.org/trunk@21825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2012-09-12 02:16:46 +00:00
parent 6a71516a85
commit 9f6fe3c4ff
2 changed files with 6 additions and 17 deletions

View File

@@ -2549,6 +2549,10 @@ function wp_maybe_load_widgets() {
*/
function wp_widgets_add_menu() {
global $submenu;
if ( ! current_theme_supports( 'widgets' ) )
return;
$submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' );
ksort( $submenu['themes.php'], SORT_NUMERIC );
}