<!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-&gt;add_cap( 'add_users' );
</span><span class="cx">                 $role-&gt;add_cap( 'promote_users' );
</span><span class="cx">                 $role-&gt;add_cap( 'edit_theme_options' );
</span><ins>+                $role-&gt;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 &lt; 11958 )
</span><span class="cx">                 upgrade_290();
</span><span class="cx"> 
</span><del>-        if ( $wp_current_db_version &lt; 14726 )
</del><ins>+        if ( $wp_current_db_version &lt; 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 &lt; 14139 ) {
</del><ins>+        if ( $wp_current_db_version &lt; 14984 )
</ins><span class="cx">                 populate_roles_300();
</span><del>-                if ( is_multisite() &amp;&amp; is_main_site() &amp;&amp; ! defined( 'MULTISITE' ) &amp;&amp; get_site_option( 'siteurl' ) === false )
-                        add_site_option( 'siteurl', '' );
-        }
</del><span class="cx"> 
</span><ins>+        if ( $wp_current_db_version &lt; 14139 &amp;&amp; is_multisite() &amp;&amp; is_main_site() &amp;&amp; ! defined( 'MULTISITE' ) &amp;&amp; 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 &gt;= 13226 &amp;&amp; $wp_current_db_version &lt; 13974 )
</span><span class="cx">                 $wpdb-&gt;query( &quot;DELETE FROM $wpdb-&gt;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' )&quot; );
</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&amp;#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[] = '&lt;a href=&quot;' . $activate_link .  '&quot; class=&quot;activatelink&quot; title=&quot;' . $activate_text . '&quot;&gt;' . __('Activate') . '&lt;/a&gt;';
</span><span class="cx">         $actions[] = '&lt;a href=&quot;' . $preview_link . '&quot; class=&quot;thickbox thickbox-preview&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $theme_name)) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</span><del>-        if ( current_user_can('update_themes') )
-                $actions[] = '&lt;a class=&quot;submitdelete deletion&quot; href=&quot;' . wp_nonce_url(&quot;themes.php?action=delete&amp;amp;template=$stylesheet&quot;, 'delete-theme_' . $stylesheet) . '&quot; onclick=&quot;' . &quot;if ( confirm('&quot; . esc_js(sprintf( __(&quot;You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $theme_name )) . &quot;') ) {return true;}return false;&quot; . '&quot;&gt;' . __('Delete') . '&lt;/a&gt;';
</del><ins>+        if ( current_user_can('delete_themes') )
+                $actions[] = '&lt;a class=&quot;submitdelete deletion&quot; href=&quot;' . wp_nonce_url(&quot;themes.php?action=delete&amp;amp;template=$stylesheet&quot;, 'delete-theme_' . $stylesheet) . '&quot; onclick=&quot;' . &quot;return confirm('&quot; . esc_js(sprintf( __(&quot;You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $theme_name )) . &quot;');&quot; . '&quot;&gt;' . __('Delete') . '&lt;/a&gt;';
</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>