Make WordPress Core


Ignore:
Timestamp:
05/27/2010 09:49:38 AM (15 years ago)
Author:
dd32
Message:

Fully implement the 'delete_themes' capability. See also r13547

File:
1 edited

Legend:

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

    r14951 r14984  
    2121    } else if ( 'delete' == $_GET['action'] ) {
    2222        check_admin_referer('delete-theme_' . $_GET['template']);
    23         if ( !current_user_can('update_themes') )
     23        if ( !current_user_can('delete_themes') )
    2424            wp_die( __( 'Cheatin’ uh?' ) );
    2525        delete_theme($_GET['template']);
     
    194194    $actions[] = '<a href="' . $activate_link .  '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
    195195    $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $theme_name)) . '">' . __('Preview') . '</a>';
    196     if ( current_user_can('update_themes') )
    197         $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet) . '" onclick="' . "if ( confirm('" . esc_js(sprintf( __("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';
     196    if ( current_user_can('delete_themes') )
     197        $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm('" . esc_js(sprintf( __("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name )) . "');" . '">' . __('Delete') . '</a>';
    198198    $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
    199199
Note: See TracChangeset for help on using the changeset viewer.