<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14984] trunk: Fully implement the 'delete_themes' capability.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14984">14984</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-05-27 09:49:38 +0000 (Thu, 27 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fully implement the 'delete_themes' capability. See also r13547</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminthemesphp">trunk/wp-admin/themes.php</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2010-05-27 08:52:14 UTC (rev 14983)
+++ trunk/wp-admin/includes/schema.php        2010-05-27 09:49:38 UTC (rev 14984)
</span><span class="lines">@@ -612,6 +612,7 @@
</span><span class="cx">                 $role->add_cap( 'add_users' );
</span><span class="cx">                 $role->add_cap( 'promote_users' );
</span><span class="cx">                 $role->add_cap( 'edit_theme_options' );
</span><ins>+                $role->add_cap( 'delete_themes' );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-05-27 08:52:14 UTC (rev 14983)
+++ trunk/wp-admin/includes/upgrade.php        2010-05-27 09:49:38 UTC (rev 14984)
</span><span class="lines">@@ -440,7 +440,7 @@
</span><span class="cx">         if ( $wp_current_db_version < 11958 )
</span><span class="cx">                 upgrade_290();
</span><span class="cx">
</span><del>-        if ( $wp_current_db_version < 14726 )
</del><ins>+        if ( $wp_current_db_version < 14984 )
</ins><span class="cx">                 upgrade_300();
</span><span class="cx">
</span><span class="cx">         maybe_disable_automattic_widgets();
</span><span class="lines">@@ -1108,12 +1108,12 @@
</span><span class="cx"> function upgrade_300() {
</span><span class="cx">         global $wp_current_db_version, $wpdb;
</span><span class="cx">
</span><del>-        if ( $wp_current_db_version < 14139 ) {
</del><ins>+        if ( $wp_current_db_version < 14984 )
</ins><span class="cx">                 populate_roles_300();
</span><del>-                if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
-                        add_site_option( 'siteurl', '' );
-        }
</del><span class="cx">
</span><ins>+        if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
+                add_site_option( 'siteurl', '' );
+
</ins><span class="cx">         // 3.0-alpha nav menu postmeta changes. can be removed before release. // r13802
</span><span class="cx">         if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13974 )
</span><span class="cx">                 $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append', 'menu_item_type', 'menu_item_object_id', 'menu_item_target', 'menu_item_classes', 'menu_item_xfn', 'menu_item_url' )" );
</span></span></pre></div>
<a id="trunkwpadminthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/themes.php (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/themes.php        2010-05-27 08:52:14 UTC (rev 14983)
+++ trunk/wp-admin/themes.php        2010-05-27 09:49:38 UTC (rev 14984)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">                 exit;
</span><span class="cx">         } else if ( 'delete' == $_GET['action'] ) {
</span><span class="cx">                 check_admin_referer('delete-theme_' . $_GET['template']);
</span><del>-                if ( !current_user_can('update_themes') )
</del><ins>+                if ( !current_user_can('delete_themes') )
</ins><span class="cx">                         wp_die( __( 'Cheatin&#8217; uh?' ) );
</span><span class="cx">                 delete_theme($_GET['template']);
</span><span class="cx">                 wp_redirect('themes.php?deleted=true');
</span><span class="lines">@@ -193,8 +193,8 @@
</span><span class="cx">         $actions = array();
</span><span class="cx">         $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
</span><span class="cx">         $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $theme_name)) . '">' . __('Preview') . '</a>';
</span><del>-        if ( current_user_can('update_themes') )
-                $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>';
</del><ins>+        if ( current_user_can('delete_themes') )
+                $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>';
</ins><span class="cx">         $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
</span><span class="cx">
</span><span class="cx">         $actions = implode ( ' | ', $actions );
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2010-05-27 08:52:14 UTC (rev 14983)
+++ trunk/wp-includes/version.php        2010-05-27 09:49:38 UTC (rev 14984)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @global int $wp_db_version
</span><span class="cx"> */
</span><del>-$wp_db_version = 14726;
</del><ins>+$wp_db_version = 14984;
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Holds the TinyMCE version
</span></span></pre>
</div>
</div>
</body>
</html>