Don't show Widgets admin page if core widgets aren't enabled. fixes #4218

git-svn-id: http://svn.automattic.com/wordpress/trunk@5376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-05-03 00:43:57 +00:00
parent 2fff1e5671
commit ab530a67d5
2 changed files with 4 additions and 1 deletions

View File

@ -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['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php');
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.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'); $submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php');
// Create list of page plugin hook names. // Create list of page plugin hook names.

View File

@ -1506,6 +1506,10 @@ function wp_parse_args( $args, $defaults = '' ) {
function wp_maybe_load_widgets() { function wp_maybe_load_widgets() {
if ( !function_exists( 'dynamic_sidebar' ) ) { if ( !function_exists( 'dynamic_sidebar' ) ) {
require_once ABSPATH . WPINC . '/widgets.php'; 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' );
}
} }
} }