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:
parent
2fff1e5671
commit
ab530a67d5
|
@ -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.
|
||||
|
|
|
@ -1506,6 +1506,10 @@ function wp_parse_args( $args, $defaults = '' ) {
|
|||
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