Changeset 5376

Show
Ignore:
Timestamp:
05/03/07 00:43:57 (2 years ago)
Author:
rob1n
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/wp-admin/menu.php

    r5294 r5376  
    6868 
    6969$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); 
    70 $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); 
    7170$submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); 
    7271 
  • branches/2.2/wp-includes/functions.php

    r5371 r5376  
    14731473    if ( !function_exists( 'dynamic_sidebar' ) ) { 
    14741474        require_once ABSPATH . WPINC . '/widgets.php'; 
     1475         
     1476        if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false && isset( $GLOBALS['submenu'] ) ) { 
     1477            $GLOBALS['submenu']['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); 
     1478        } 
    14751479    } 
    14761480} 
  • trunk/wp-admin/menu.php

    r5297 r5376  
    6868 
    6969$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); 
    70 $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); 
    7170$submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); 
    7271 
  • trunk/wp-includes/functions.php

    r5370 r5376  
    15071507    if ( !function_exists( 'dynamic_sidebar' ) ) { 
    15081508        require_once ABSPATH . WPINC . '/widgets.php'; 
     1509         
     1510        if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false && isset( $GLOBALS['submenu'] ) ) { 
     1511            $GLOBALS['submenu']['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); 
     1512        } 
    15091513    } 
    15101514}