Changeset 14581 for trunk/wp-admin/themes.php
- Timestamp:
- 05/12/2010 07:19:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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>
Note: See TracChangeset
for help on using the changeset viewer.