Changeset 14581
- Timestamp:
- 05/12/2010 07:19:57 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r14404 r14581 133 133 break; 134 134 case 'menu-quick-search': 135 if ( ! current_user_can( ' switch_themes' ) )135 if ( ! current_user_can( 'edit_theme_options' ) ) 136 136 die('-1'); 137 137 … … 400 400 $menu_item_id = (int) $_POST['menu-item']; 401 401 check_admin_referer( 'delete-menu_item_' . $menu_item_id ); 402 if ( ! current_user_can( ' switch_themes' ) )402 if ( ! current_user_can( 'edit_theme_options' ) ) 403 403 die('-1'); 404 404 … … 818 818 break; 819 819 case 'add-menu-item' : 820 if ( ! current_user_can( ' switch_themes' ) )820 if ( ! current_user_can( 'edit_theme_options' ) ) 821 821 die('-1'); 822 822 … … 1092 1092 break; 1093 1093 case 'menu-quick-search': 1094 if ( ! current_user_can( ' switch_themes' ) )1094 if ( ! current_user_can( 'edit_theme_options' ) ) 1095 1095 die('-1'); 1096 1096 … … 1329 1329 check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' ); 1330 1330 1331 if ( !current_user_can(' switch_themes') )1331 if ( !current_user_can('edit_theme_options') ) 1332 1332 die('-1'); 1333 1333 … … 1359 1359 check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' ); 1360 1360 1361 if ( !current_user_can(' switch_themes') || !isset($_POST['id_base']) )1361 if ( !current_user_can('edit_theme_options') || !isset($_POST['id_base']) ) 1362 1362 die('-1'); 1363 1363 -
trunk/wp-admin/custom-background.php
r14578 r14581 53 53 */ 54 54 function init() { 55 if ( ! current_user_can(' switch_themes') )55 if ( ! current_user_can('edit_theme_options') ) 56 56 return; 57 57 58 $page = add_theme_page(__('Background'), __('Background'), ' switch_themes', 'custom-background', array(&$this, 'admin_page'));58 $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page')); 59 59 60 60 add_action("load-$page", array(&$this, 'admin_load')); -
trunk/wp-admin/custom-header.php
r14443 r14581 62 62 */ 63 63 function init() { 64 if ( ! current_user_can(' switch_themes') )64 if ( ! current_user_can('edit_theme_options') ) 65 65 return; 66 66 67 $page = add_theme_page(__('Header'), __('Header'), ' switch_themes', 'custom-header', array(&$this, 'admin_page'));67 $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page')); 68 68 69 69 add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); … … 126 126 */ 127 127 function take_action() { 128 if ( ! current_user_can(' switch_themes') )128 if ( ! current_user_can('edit_theme_options') ) 129 129 return; 130 130 … … 598 598 */ 599 599 function admin_page() { 600 if ( ! current_user_can(' switch_themes') )600 if ( ! current_user_can('edit_theme_options') ) 601 601 wp_die(__('You do not have permission to customize headers.')); 602 602 $step = $this->step(); -
trunk/wp-admin/includes/dashboard.php
r14407 r14581 357 357 $num = number_format_i18n( $num_widgets ); 358 358 359 if ( current_user_can( 'switch_themes' ) ) { 359 $switch_themes = $ct->title; 360 if ( current_user_can( 'switch_themes') ) { 360 361 echo '<a href="themes.php" class="button rbutton">' . __('Change Theme') . '</a>'; 361 printf(_n('Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $ct->title, $num); 362 $switch_themes = '<a href="themes.php">' . $switch_themes . '</a>'; 363 } 364 if ( current_user_can( 'edit_theme_options' ) ) { 365 printf(_n('Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $switch_themes, $num); 362 366 } else { 363 printf(_n('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $ ct->title, $num);367 printf(_n('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $switch_themes, $num); 364 368 } 365 369 } else { -
trunk/wp-admin/menu.php
r14571 r14581 146 146 $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); 147 147 148 $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 149 $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); 150 $submenu['themes.php'][10] = array(__('Menus'), 'switch_themes', 'nav-menus.php'); 148 if ( current_user_can( 'switch_themes') ) { 149 $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 150 $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); 151 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php'); 152 } else { 153 $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 154 $submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php'); 155 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' ); 156 } 151 157 152 158 // Add 'Editor' to the bottom of the Appearence menu. … … 282 288 283 289 // Loop over the top-level menu. 284 // Menus for which the original parent is not ac essible due to lack of privs will have the next290 // Menus for which the original parent is not accessible due to lack of privs will have the next 285 291 // submenu in line be assigned as the new menu parent. 286 292 foreach ( $menu as $id => $data ) { -
trunk/wp-admin/nav-menus.php
r14571 r14581 17 17 18 18 // Permissions Check 19 if ( ! current_user_can(' switch_themes') )20 wp_die( __( 'Cheatin’ uh?' ) );19 if ( ! current_user_can('edit_theme_options') ) 20 wp_die( __( 'Cheatin’ uh?' ) ); 21 21 22 22 // Nav Menu CSS … … 52 52 switch ( $action ) { 53 53 case 'add-menu-item': 54 if ( current_user_can( 'switch_themes' ) ) { 55 check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' ); 56 if ( isset( $_REQUEST['menu-item'] ) ) { 57 wp_save_nav_menu_item( $nav_menu_selected_id, $_REQUEST['menu-item'] ); 58 } 59 } 54 check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' ); 55 if ( isset( $_REQUEST['menu-item'] ) ) 56 wp_save_nav_menu_item( $nav_menu_selected_id, $_REQUEST['menu-item'] ); 60 57 break; 61 58 case 'move-down-menu-item' : -
trunk/wp-admin/themes.php
r14443 r14581 10 10 require_once('./admin.php'); 11 11 12 if ( !current_user_can('switch_themes') )12 if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) 13 13 wp_die( __( 'Cheatin’ uh?' ) ); 14 14 15 if ( isset($_GET['action']) ) {15 if ( current_user_can('switch_themes') && isset($_GET['action']) ) { 16 16 if ( 'activate' == $_GET['action'] ) { 17 17 check_admin_referer('switch-theme_' . $_GET['template']); … … 32 32 $parent_file = 'themes.php'; 33 33 34 if ( current_user_can( 'switch_themes' ) ) : 35 34 36 $help = '<p>' . __('Themes give your WordPress style. Once a theme is installed, you may preview it, activate it or deactivate it here.') . '</p>'; 35 37 if ( current_user_can('install_themes') ) { … … 43 45 wp_enqueue_script( 'theme-preview' ); 44 46 47 endif; 48 45 49 require_once('./admin-header.php'); 46 50 if ( is_multisite() && current_user_can('edit_themes') ) { … … 52 56 <div id="message1" class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> 53 57 <?php elseif ( isset($_GET['activated']) ) : 54 if ( isset($wp_registered_sidebars) && count( (array) $wp_registered_sidebars ) ) { ?>58 if ( isset($wp_registered_sidebars) && count( (array) $wp_registered_sidebars ) && current_user_can('edit_theme_options') ) { ?> 55 59 <div id="message2" class="updated"><p><?php printf( __('New theme activated. This theme supports widgets, please visit the <a href="%s">widgets settings</a> screen to configure them.'), admin_url( 'widgets.php' ) ); ?></p></div><?php 56 60 } else { ?> … … 115 119 116 120 <div class="clear"></div> 121 <?php 122 if ( ! current_user_can( 'switch_themes' ) ) { 123 echo '</div>'; 124 require( './admin-footer.php' ); 125 exit; 126 } 127 ?> 117 128 <h3><?php _e('Available Themes'); ?></h3> 118 129 <div class="clear"></div> -
trunk/wp-admin/widgets.php
r14374 r14581 13 13 require_once(ABSPATH . 'wp-admin/includes/widgets.php'); 14 14 15 if ( ! current_user_can(' switch_themes') )15 if ( ! current_user_can('edit_theme_options') ) 16 16 wp_die( __( 'Cheatin’ uh?' )); 17 17 -
trunk/wp-includes/functions.php
r14539 r14581 2975 2975 function wp_widgets_add_menu() { 2976 2976 global $submenu; 2977 $submenu['themes.php'][7] = array( __( 'Widgets' ), ' switch_themes', 'widgets.php' );2977 $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); 2978 2978 ksort( $submenu['themes.php'], SORT_NUMERIC ); 2979 2979 }
Note: See TracChangeset
for help on using the changeset viewer.