Don't show Widgets admin page if core widgets aren't enabled. fixes #4218
git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6ecf459918
commit
6f2a4b74a9
|
@ -67,7 +67,6 @@ $submenu['plugins.php'][5] = array(__('Plugins'), 'activate_plugins', 'plugins.p
|
|||
$submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php');
|
||||
|
||||
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
|
||||
$submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' );
|
||||
$submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php');
|
||||
|
||||
// Create list of page plugin hook names.
|
||||
|
|
|
@ -1472,6 +1472,10 @@ function smilies_init() {
|
|||
function wp_maybe_load_widgets() {
|
||||
if ( !function_exists( 'dynamic_sidebar' ) ) {
|
||||
require_once ABSPATH . WPINC . '/widgets.php';
|
||||
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false && isset( $GLOBALS['submenu'] ) ) {
|
||||
$GLOBALS['submenu']['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue