Make WordPress Core


Ignore:
Timestamp:
01/18/2010 10:21:36 PM (15 years ago)
Author:
ryan
Message:

Use cap checks instead of multisite and super admin checks. Add some new caps. Merge cleanup. see #11644.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/themes.php

    r12752 r12753  
    6868
    6969require_once('admin-header.php');
    70 if ( is_multisite() && is_super_admin() ) {
     70if ( is_multisite() && current_user_can('edit_themes') ) {
    7171    ?><div id="message0" class="updated fade"><p><?php _e('Administrator: new themes must be activated in the <a href="wpmu-themes.php">Themes Admin</a> page before they appear here.'); ?></p></div><?php
    7272}
     
    127127    static $themes_update;
    128128
    129     if ( is_multisite() && !is_super_admin() )
     129    if ( !current_user_can('update_themes' ) )
    130130        return;
    131131
     
    160160<div class="wrap">
    161161<?php screen_icon(); ?>
    162 <h2><?php echo esc_html( $title ); if ( !is_multisite() || is_super_admin() ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php } ?></h2>
     162<h2><?php echo esc_html( $title ); if ( !current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php } ?></h2>
    163163
    164164<h3><?php _e('Current Theme'); ?></h3>
     
    171171    printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h4>
    172172<p class="theme-description"><?php echo $ct->description; ?></p>
    173 <?php if ( ( !is_multisite() || is_super_admin() ) && $ct->parent_theme ) { ?>
     173<?php if ( current_user_can('edit_themes') && $ct->parent_theme ) { ?>
    174174    <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?></p>
    175175<?php } else { ?>
     
    266266<p class="description"><?php echo $description; ?></p>
    267267<span class='action-links'><?php echo $actions ?></span>
    268     <?php if ( ( !is_multisite() || is_super_admin() ) && $parent_theme ) {
     268    <?php if ( current_user_can('edit_themes') && $parent_theme ) {
    269269    /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
    270270    <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?></p>
     
    299299// List broken themes, if any.
    300300$broken_themes = get_broken_themes();
    301 if ( ( !is_multisite() || is_super_admin() ) && count( $broken_themes ) ) {
     301if ( current_user_can('edit_themes') && count( $broken_themes ) ) {
    302302?>
    303303
Note: See TracChangeset for help on using the changeset viewer.