<!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>[14593] trunk:
  Move taxonomy object properties for capabilities into a cap object.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14593">14593</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-13 04:10:17 +0000 (Thu, 13 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move taxonomy object properties for capabilities into a cap object. Capabilities can be specified via ['capabilities'] (an array keyed by the generic cap name) for register_taxonomy. fixes <a href="http://trac.wordpress.org/ticket/13358">#13358</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
<li><a href="#trunkwpadminpressthisphp">trunk/wp-admin/press-this.php</a></li>
<li><a href="#trunkwpadmintoolsphp">trunk/wp-admin/tools.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludestaxonomyphp">trunk/wp-includes/taxonomy.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/admin-ajax.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx">         $action = $_POST['action'];
</span><span class="cx">         $taxonomy = get_taxonomy(substr($action, 4));
</span><span class="cx">         check_ajax_referer( $action );
</span><del>-        if ( !current_user_can( $taxonomy-&gt;edit_cap ) )
</del><ins>+        if ( !current_user_can( $taxonomy-&gt;cap-&gt;edit_terms ) )
</ins><span class="cx">                 die('-1');
</span><span class="cx">         $names = explode(',', $_POST['new'.$taxonomy-&gt;name]);
</span><span class="cx">         $parent = isset($_POST['new'.$taxonomy-&gt;name.'_parent']) ? (int) $_POST['new'.$taxonomy-&gt;name.'_parent'] : 0;
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx">         $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><span class="cx"> 
</span><del>-        if ( !current_user_can( $tax-&gt;delete_cap ) )
</del><ins>+        if ( !current_user_can( $tax-&gt;cap-&gt;delete_terms ) )
</ins><span class="cx">                 die('-1');
</span><span class="cx"> 
</span><span class="cx">         $tag = get_term( $tag_id, $taxonomy );
</span><span class="lines">@@ -566,7 +566,7 @@
</span><span class="cx"> 
</span><span class="cx">         $x = new WP_Ajax_Response();
</span><span class="cx"> 
</span><del>-        if ( !current_user_can( $tax-&gt;edit_cap ) )
</del><ins>+        if ( !current_user_can( $tax-&gt;cap-&gt;edit_terms ) )
</ins><span class="cx">                 die('-1');
</span><span class="cx"> 
</span><span class="cx">         $tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
</span><span class="lines">@@ -1204,7 +1204,7 @@
</span><span class="cx">                 die( __('Cheatin&amp;#8217; uh?') );
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><span class="cx"> 
</span><del>-        if ( ! current_user_can( $tax-&gt;edit_cap ) )
</del><ins>+        if ( ! current_user_can( $tax-&gt;cap-&gt;edit_terms ) )
</ins><span class="cx">                 die( __('Cheatin&amp;#8217; uh?') );
</span><span class="cx"> 
</span><span class="cx">         if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/edit-tags.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">         check_admin_referer('add-tag');
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($tax-&gt;edit_cap) )
</del><ins>+        if ( !current_user_can($tax-&gt;cap-&gt;edit_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><span class="cx">         $ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST);
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">         $tag_ID = (int) $_GET['tag_ID'];
</span><span class="cx">         check_admin_referer('delete-tag_' .  $tag_ID);
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($tax-&gt;delete_cap) )
</del><ins>+        if ( !current_user_can($tax-&gt;cap-&gt;delete_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><span class="cx">         wp_delete_term( $tag_ID, $taxonomy);
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> case 'bulk-delete':
</span><span class="cx">         check_admin_referer('bulk-tags');
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($tax-&gt;delete_cap) )
</del><ins>+        if ( !current_user_can($tax-&gt;cap-&gt;delete_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><span class="cx">         $tags = (array) $_GET['delete_tags'];
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">         $tag_ID = (int) $_POST['tag_ID'];
</span><span class="cx">         check_admin_referer('update-tag_' . $tag_ID);
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($tax-&gt;edit_cap) )
</del><ins>+        if ( !current_user_can($tax-&gt;cap-&gt;edit_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><span class="cx">         $ret = wp_update_term($tag_ID, $taxonomy, $_POST);
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> wp_enqueue_script('admin-tags');
</span><del>-if ( current_user_can($tax-&gt;edit_cap) )
</del><ins>+if ( current_user_can($tax-&gt;cap-&gt;edit_terms) )
</ins><span class="cx">         wp_enqueue_script('inline-edit-tax');
</span><span class="cx"> 
</span><span class="cx"> require_once ('admin-header.php');
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx"> &lt;div class=&quot;col-wrap&quot;&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><del>-if ( current_user_can( $tax-&gt;edit_cap ) )
</del><ins>+if ( current_user_can( $tax-&gt;cap-&gt;edit_terms ) )
</ins><span class="cx">         $tag_cloud = wp_tag_cloud( array( 'taxonomy' =&gt; $taxonomy, 'echo' =&gt; false, 'link' =&gt; 'edit' ) );
</span><span class="cx"> else
</span><span class="cx">         $tag_cloud = wp_tag_cloud( array( 'taxonomy' =&gt; $taxonomy, 'echo' =&gt; false ) );
</span><span class="lines">@@ -332,7 +332,7 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> endif;
</span><span class="cx"> 
</span><del>-if ( current_user_can($tax-&gt;edit_cap) ) {
</del><ins>+if ( current_user_can($tax-&gt;cap-&gt;edit_terms) ) {
</ins><span class="cx">         if ( 'category' == $taxonomy )
</span><span class="cx">                 do_action('add_category_form_pre', (object)array('parent' =&gt; 0) );  // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form
</span><span class="cx">         else
</span></span></pre></div>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/includes/meta-boxes.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -249,14 +249,14 @@
</span><span class="cx">         $help_nojs  = isset( $taxonomy-&gt;help_nojs  ) ? $taxonomy-&gt;help_nojs         : __('Add or remove tags');
</span><span class="cx">         $help_cloud = isset( $taxonomy-&gt;help_cloud ) ? $taxonomy-&gt;help_cloud        : __('Choose from the most used tags in %s');
</span><span class="cx"> 
</span><del>-        $disabled = !current_user_can($taxonomy-&gt;assign_cap) ? 'disabled=&quot;disabled&quot;' : '';
</del><ins>+        $disabled = !current_user_can($taxonomy-&gt;cap-&gt;assign_terms) ? 'disabled=&quot;disabled&quot;' : '';
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;tagsdiv&quot; id=&quot;&lt;?php echo $tax_name; ?&gt;&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;jaxtag&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;nojs-tags hide-if-js&quot;&gt;
</span><span class="cx">         &lt;p&gt;&lt;?php echo $help_nojs; ?&gt;&lt;/p&gt;
</span><span class="cx">         &lt;textarea name=&quot;&lt;?php echo &quot;tax_input[$tax_name]&quot;; ?&gt;&quot; class=&quot;the-tags&quot; id=&quot;tax-input[&lt;?php echo $tax_name; ?&gt;]&quot; &lt;?php echo $disabled; ?&gt;&gt;&lt;?php echo esc_attr(get_terms_to_edit( $post-&gt;ID, $tax_name )); ?&gt;&lt;/textarea&gt;&lt;/div&gt;
</span><del>-         &lt;?php if ( current_user_can($taxonomy-&gt;assign_cap) ) : ?&gt;
</del><ins>+         &lt;?php if ( current_user_can($taxonomy-&gt;cap-&gt;assign_terms) ) : ?&gt;
</ins><span class="cx">         &lt;div class=&quot;ajaxtag hide-if-no-js&quot;&gt;
</span><span class="cx">                 &lt;label class=&quot;screen-reader-text&quot; for=&quot;new-tag-&lt;?php echo $tax_name; ?&gt;&quot;&gt;&lt;?php echo $box['title']; ?&gt;&lt;/label&gt;
</span><span class="cx">                 &lt;div class=&quot;taghint&quot;&gt;&lt;?php echo $help_hint; ?&gt;&lt;/div&gt;
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;tagchecklist&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><del>-&lt;?php if ( current_user_can($taxonomy-&gt;assign_cap) ) : ?&gt;
</del><ins>+&lt;?php if ( current_user_can($taxonomy-&gt;cap-&gt;assign_terms) ) : ?&gt;
</ins><span class="cx"> &lt;p class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#titlediv&quot; class=&quot;tagcloud-link&quot; id=&quot;link-&lt;?php echo $tax_name; ?&gt;&quot;&gt;&lt;?php printf( $help_cloud, $box['title'] ); ?&gt;&lt;/a&gt;&lt;/p&gt;
</span><span class="cx"> &lt;?php else : ?&gt;
</span><span class="cx"> &lt;p&gt;&lt;em&gt;&lt;?php _e('You cannot modify this Taxonomy.'); ?&gt;&lt;/em&gt;&lt;/p&gt;
</span><span class="lines">@@ -315,10 +315,10 @@
</span><span class="cx">                                 &lt;?php wp_terms_checklist($post-&gt;ID, array( 'taxonomy' =&gt; $taxonomy, 'popular_cats' =&gt; $popular_ids ) ) ?&gt;
</span><span class="cx">                         &lt;/ul&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><del>-        &lt;?php if ( !current_user_can($tax-&gt;assign_cap) ) : ?&gt;
</del><ins>+        &lt;?php if ( !current_user_can($tax-&gt;cap-&gt;assign_terms) ) : ?&gt;
</ins><span class="cx">         &lt;p&gt;&lt;em&gt;&lt;?php _e('You cannot modify this Taxonomy.'); ?&gt;&lt;/em&gt;&lt;/p&gt;
</span><span class="cx">         &lt;?php endif; ?&gt;
</span><del>-        &lt;?php if ( current_user_can($tax-&gt;edit_cap) ) : ?&gt;
</del><ins>+        &lt;?php if ( current_user_can($tax-&gt;cap-&gt;edit_terms) ) : ?&gt;
</ins><span class="cx">                         &lt;div id=&quot;&lt;?php echo $taxonomy; ?&gt;-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
</span><span class="cx">                                 &lt;h4&gt;&lt;a id=&quot;&lt;?php echo $taxonomy; ?&gt;-add-toggle&quot; href=&quot;#&lt;?php echo $taxonomy; ?&gt;-add&quot; class=&quot;hide-if-no-js&quot; tabindex=&quot;3&quot;&gt;&lt;?php printf( __( '+ Add New %s' ), $tax-&gt;singular_label ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
</span><span class="cx">                                 &lt;p id=&quot;&lt;?php echo $taxonomy; ?&gt;-add&quot; class=&quot;category-add wp-hidden-child&quot;&gt;
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/includes/post.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx"> 
</span><span class="cx">                 foreach ( $tax_names as $tax_name ) {
</span><span class="cx">                         $taxonomy_obj = get_taxonomy($tax_name);
</span><del>-                        if(  isset( $tax_input[$tax_name]) &amp;&amp; current_user_can( $taxonomy_obj-&gt;assign_cap ) )
</del><ins>+                        if(  isset( $tax_input[$tax_name]) &amp;&amp; current_user_can( $taxonomy_obj-&gt;cap-&gt;assign_terms ) )
</ins><span class="cx">                                 $new_terms = $tax_input[$tax_name];
</span><span class="cx">                         else 
</span><span class="cx">                                 $new_terms = array();
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/includes/template.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> function inline_edit_term_row($type, $taxonomy) {
</span><span class="cx"> 
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><del>-        if ( ! current_user_can( $tax-&gt;edit_cap ) )
</del><ins>+        if ( ! current_user_can( $tax-&gt;cap-&gt;edit_terms ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         $columns = get_column_headers($type);
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx">         $args = array('taxonomy' =&gt; $taxonomy);
</span><span class="cx"> 
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><del>-        $args['disabled'] = !current_user_can($tax-&gt;assign_cap);
</del><ins>+        $args['disabled'] = !current_user_can($tax-&gt;cap-&gt;assign_terms);
</ins><span class="cx"> 
</span><span class="cx">         if ( is_array( $selected_cats ) )
</span><span class="cx">                 $args['selected_cats'] = $selected_cats;
</span><span class="lines">@@ -324,7 +324,7 @@
</span><span class="cx">         $terms = get_terms( $taxonomy, array( 'orderby' =&gt; 'count', 'order' =&gt; 'DESC', 'number' =&gt; $number, 'hierarchical' =&gt; false ) );
</span><span class="cx"> 
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><del>-        if ( ! current_user_can($tax-&gt;assign_cap) )
</del><ins>+        if ( ! current_user_can($tax-&gt;cap-&gt;assign_terms) )
</ins><span class="cx">                 $disabled = 'disabled=&quot;disabled&quot;';
</span><span class="cx">         else
</span><span class="cx">                 $disabled = '';
</span><span class="lines">@@ -436,7 +436,7 @@
</span><span class="cx"> 
</span><span class="cx">                         switch ($column_name) {
</span><span class="cx">                                 case 'cb':
</span><del>-                                        if ( current_user_can($tax-&gt;delete_cap) &amp;&amp; $tag-&gt;term_id != $default_term )
</del><ins>+                                        if ( current_user_can($tax-&gt;cap-&gt;delete_terms) &amp;&amp; $tag-&gt;term_id != $default_term )
</ins><span class="cx">                                                 $out .= '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt; &lt;input type=&quot;checkbox&quot; name=&quot;delete_tags[]&quot; value=&quot;' . $tag-&gt;term_id . '&quot; /&gt;&lt;/th&gt;';
</span><span class="cx">                                         else
</span><span class="cx">                                                 $out .= '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&amp;nbsp;&lt;/th&gt;';
</span><span class="lines">@@ -444,11 +444,11 @@
</span><span class="cx">                                 case 'name':
</span><span class="cx">                                         $out .= '&lt;td ' . $attributes . '&gt;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;' . $edit_link . '&quot; title=&quot;' . esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $name)) . '&quot;&gt;' . $name . '&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;';
</span><span class="cx">                                         $actions = array();
</span><del>-                                        if ( current_user_can($tax-&gt;edit_cap) ) {
</del><ins>+                                        if ( current_user_can($tax-&gt;cap-&gt;edit_terms) ) {
</ins><span class="cx">                                                 $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span><span class="cx">                                                 $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
</span><span class="cx">                                         }
</span><del>-                                        if ( current_user_can($tax-&gt;delete_cap) &amp;&amp; $tag-&gt;term_id != $default_term )
</del><ins>+                                        if ( current_user_can($tax-&gt;cap-&gt;delete_terms) &amp;&amp; $tag-&gt;term_id != $default_term )
</ins><span class="cx">                                                 $actions['delete'] = &quot;&lt;a class='delete-tag' href='&quot; . wp_nonce_url(&quot;edit-tags.php?action=delete&amp;amp;taxonomy=$taxonomy&amp;amp;tag_ID=$tag-&gt;term_id&quot;, 'delete-tag_' . $tag-&gt;term_id) . &quot;'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
</span><span class="cx"> 
</span><span class="cx">                                         $actions = apply_filters('tag_row_actions', $actions, $tag);
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/menu.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">                 if ( ! $tax-&gt;show_ui || ! in_array('post', (array) $tax-&gt;object_type, true) )
</span><span class="cx">                         continue;
</span><span class="cx"> 
</span><del>-                $submenu['edit.php'][$i++] = array( esc_attr($tax-&gt;label), $tax-&gt;manage_cap, 'edit-tags.php?taxonomy=' . $tax-&gt;name );
</del><ins>+                $submenu['edit.php'][$i++] = array( esc_attr($tax-&gt;label), $tax-&gt;cap-&gt;manage_terms, 'edit-tags.php?taxonomy=' . $tax-&gt;name );
</ins><span class="cx">         }
</span><span class="cx">         unset($tax);
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">                 if ( ! $tax-&gt;show_ui || ! in_array($ptype, (array) $tax-&gt;object_type, true) )
</span><span class="cx">                         continue;
</span><span class="cx"> 
</span><del>-                $submenu[&quot;edit.php?post_type=$ptype&quot;][$i++] = array( esc_attr($tax-&gt;label), $tax-&gt;manage_cap, &quot;edit-tags.php?taxonomy=$tax-&gt;name&amp;amp;post_type=$ptype&quot; );
</del><ins>+                $submenu[&quot;edit.php?post_type=$ptype&quot;][$i++] = array( esc_attr($tax-&gt;label), $tax-&gt;cap-&gt;manage_terms, &quot;edit-tags.php?taxonomy=$tax-&gt;name&amp;amp;post_type=$ptype&quot; );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> unset($ptype, $ptype_obj);
</span></span></pre></div>
<a id="trunkwpadminpressthisphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/press-this.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/press-this.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/press-this.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -504,10 +504,10 @@
</span><span class="cx">                                                 &lt;/ul&gt;
</span><span class="cx">                                         &lt;/div&gt;
</span><span class="cx"> 
</span><del>-                                        &lt;?php if ( !current_user_can($tax-&gt;assign_cap) ) : ?&gt;
</del><ins>+                                        &lt;?php if ( !current_user_can($tax-&gt;cap-&gt;assign_terms) ) : ?&gt;
</ins><span class="cx">                                         &lt;p&gt;&lt;em&gt;&lt;?php _e('You cannot modify this Taxonomy.'); ?&gt;&lt;/em&gt;&lt;/p&gt;
</span><span class="cx">                                         &lt;?php endif; ?&gt;
</span><del>-                                        &lt;?php if ( current_user_can($tax-&gt;edit_cap) ) : ?&gt;
</del><ins>+                                        &lt;?php if ( current_user_can($tax-&gt;cap-&gt;edit_terms) ) : ?&gt;
</ins><span class="cx">                                                 &lt;div id=&quot;category-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
</span><span class="cx">                                                         &lt;h4&gt;&lt;a id=&quot;category-add-toggle&quot; href=&quot;#category-add&quot; class=&quot;hide-if-no-js&quot; tabindex=&quot;3&quot;&gt;&lt;?php printf( __( '+ Add New %s' ), $tax-&gt;singular_label ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
</span><span class="cx">                                                         &lt;p id=&quot;category-add&quot; class=&quot;category-add wp-hidden-child&quot;&gt;
</span></span></pre></div>
<a id="trunkwpadmintoolsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/tools.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/tools.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-admin/tools.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> $cats = get_taxonomy('category');
</span><span class="cx"> $tags = get_taxonomy('post_tag');
</span><span class="cx"> 
</span><del>-if ( current_user_can($cats-&gt;manage_cap) || current_user_can($tags-&gt;manage_cap) ) : ?&gt;
</del><ins>+if ( current_user_can($cats-&gt;cap-&gt;manage_terms) || current_user_can($tags-&gt;cap-&gt;manage_terms) ) : ?&gt;
</ins><span class="cx"> &lt;div class=&quot;tool-box&quot;&gt;
</span><span class="cx">     &lt;h3 class=&quot;title&quot;&gt;&lt;?php _e('Category&amp;#47;Tag Conversion') ?&gt;&lt;/h3&gt;
</span><span class="cx">     &lt;p&gt;&lt;?php printf(__('Use this to convert &lt;a href=&quot;%s&quot;&gt;categories to tags&lt;/a&gt;, or &lt;a href=&quot;%s&quot;&gt;tags to categories&lt;/a&gt;.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&amp;amp;step=3'); ?&gt;&lt;/p&gt;
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-includes/link-template.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -646,7 +646,7 @@
</span><span class="cx"> function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) {
</span><span class="cx">         global $post_type;
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><del>-        if ( !current_user_can($tax-&gt;edit_cap) )
</del><ins>+        if ( !current_user_can($tax-&gt;cap-&gt;edit_terms) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         $tag = get_term($tag_id, $taxonomy);
</span><span class="lines">@@ -668,7 +668,7 @@
</span><span class="cx">  */
</span><span class="cx"> function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
</span><span class="cx">         $tax = get_taxonomy('post_tag');
</span><del>-        if ( !current_user_can($tax-&gt;edit_cap) )
</del><ins>+        if ( !current_user_can($tax-&gt;cap-&gt;edit_terms) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         $tag = get_term($tag, 'post_tag');
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-includes/post.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -2329,7 +2329,7 @@
</span><span class="cx">                         $taxonomy_obj = get_taxonomy($taxonomy);
</span><span class="cx">                         if ( is_array($tags) ) // array = hierarchical, string = non-hierarchical.
</span><span class="cx">                                 $tags = array_filter($tags);
</span><del>-                        if ( current_user_can($taxonomy_obj-&gt;assign_cap) )
</del><ins>+                        if ( current_user_can($taxonomy_obj-&gt;cap-&gt;assign_terms) )
</ins><span class="cx">                                 wp_set_post_terms( $post_ID, $tags, $taxonomy );
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (14592 => 14593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-05-13 03:50:26 UTC (rev 14592)
+++ trunk/wp-includes/taxonomy.php        2010-05-13 04:10:17 UTC (rev 14593)
</span><span class="lines">@@ -256,7 +256,8 @@
</span><span class="cx">                                                 'show_ui' =&gt; null,
</span><span class="cx">                                                 'label' =&gt; null,
</span><span class="cx">                                                 'show_tagcloud' =&gt; null,
</span><del>-                                                '_builtin' =&gt; false
</del><ins>+                                                '_builtin' =&gt; false,
+                                                'capabilities' =&gt; array(),
</ins><span class="cx">                                                 );
</span><span class="cx">         $args = wp_parse_args($args, $defaults);
</span><span class="cx"> 
</span><span class="lines">@@ -285,12 +286,14 @@
</span><span class="cx">         if ( is_null($args['label'] ) )
</span><span class="cx">                 $args['label'] = $taxonomy;
</span><span class="cx"> 
</span><del>-        foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) {
-                if ( empty($args[$cap]) )
-                        $args[$cap] = 'manage_categories';
-        }
-        if ( empty($args['assign_cap']) )
-                $args['assign_cap'] = 'edit_posts';
</del><ins>+        $default_caps = array(
+                'manage_terms' =&gt; 'manage_categories',
+                'edit_terms'   =&gt; 'manage_categories',
+                'delete_terms' =&gt; 'manage_categories',
+                'assign_terms' =&gt; 'edit_posts',
+        );
+        $args['cap'] = (object) array_merge( $default_caps, $args['capabilities'] );
+        unset( $args['capabilities'] );
</ins><span class="cx"> 
</span><span class="cx">         if ( empty($args['singular_label']) )
</span><span class="cx">                 $args['singular_label'] = $args['label'];
</span></span></pre>
</div>
</div>

</body>
</html>