Make WordPress Core

Changeset 14984


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

Fully implement the 'delete_themes' capability. See also r13547

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r14924 r14984  
    613613        $role->add_cap( 'promote_users' );
    614614        $role->add_cap( 'edit_theme_options' );
     615        $role->add_cap( 'delete_themes' );
    615616    }
    616617}
  • trunk/wp-admin/includes/upgrade.php

    r14727 r14984  
    441441        upgrade_290();
    442442
    443     if ( $wp_current_db_version < 14726 )
     443    if ( $wp_current_db_version < 14984 )
    444444        upgrade_300();
    445445
     
    11091109    global $wp_current_db_version, $wpdb;
    11101110
    1111     if ( $wp_current_db_version < 14139 ) {
     1111    if ( $wp_current_db_version < 14984 )
    11121112        populate_roles_300();
    1113         if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
    1114             add_site_option( 'siteurl', '' );
    1115     }
     1113
     1114    if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
     1115        add_site_option( 'siteurl', '' );
    11161116
    11171117    // 3.0-alpha nav menu postmeta changes. can be removed before release. // r13802
  • 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&#8217; 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
  • trunk/wp-includes/version.php

    r14960 r14984  
    1616 * @global int $wp_db_version
    1717 */
    18 $wp_db_version = 14726;
     18$wp_db_version = 14984;
    1919
    2020/**
Note: See TracChangeset for help on using the changeset viewer.