<!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->edit_cap ) )
</del><ins>+        if ( !current_user_can( $taxonomy->cap->edit_terms ) )
</ins><span class="cx">                 die('-1');
</span><span class="cx">         $names = explode(',', $_POST['new'.$taxonomy->name]);
</span><span class="cx">         $parent = isset($_POST['new'.$taxonomy->name.'_parent']) ? (int) $_POST['new'.$taxonomy->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->delete_cap ) )
</del><ins>+        if ( !current_user_can( $tax->cap->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->edit_cap ) )
</del><ins>+        if ( !current_user_can( $tax->cap->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&#8217; uh?') );
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><span class="cx">
</span><del>-        if ( ! current_user_can( $tax->edit_cap ) )
</del><ins>+        if ( ! current_user_can( $tax->cap->edit_terms ) )
</ins><span class="cx">                 die( __('Cheatin&#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->edit_cap) )
</del><ins>+        if ( !current_user_can($tax->cap->edit_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&#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->delete_cap) )
</del><ins>+        if ( !current_user_can($tax->cap->delete_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&#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->delete_cap) )
</del><ins>+        if ( !current_user_can($tax->cap->delete_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&#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->edit_cap) )
</del><ins>+        if ( !current_user_can($tax->cap->edit_terms) )
</ins><span class="cx">                 wp_die(__('Cheatin&#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->edit_cap) )
</del><ins>+if ( current_user_can($tax->cap->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"> <div class="col-wrap">
</span><span class="cx">
</span><span class="cx"> <?php
</span><del>-if ( current_user_can( $tax->edit_cap ) )
</del><ins>+if ( current_user_can( $tax->cap->edit_terms ) )
</ins><span class="cx">         $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
</span><span class="cx"> else
</span><span class="cx">         $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
</span><span class="lines">@@ -332,7 +332,7 @@
</span><span class="cx"> <?php
</span><span class="cx"> endif;
</span><span class="cx">
</span><del>-if ( current_user_can($tax->edit_cap) ) {
</del><ins>+if ( current_user_can($tax->cap->edit_terms) ) {
</ins><span class="cx">         if ( 'category' == $taxonomy )
</span><span class="cx">                 do_action('add_category_form_pre', (object)array('parent' => 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->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags');
</span><span class="cx">         $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s');
</span><span class="cx">
</span><del>-        $disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : '';
</del><ins>+        $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
</ins><span class="cx"> ?>
</span><span class="cx"> <div class="tagsdiv" id="<?php echo $tax_name; ?>">
</span><span class="cx">         <div class="jaxtag">
</span><span class="cx">         <div class="nojs-tags hide-if-js">
</span><span class="cx">         <p><?php echo $help_nojs; ?></p>
</span><span class="cx">         <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
</span><del>-         <?php if ( current_user_can($taxonomy->assign_cap) ) : ?>
</del><ins>+         <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
</ins><span class="cx">         <div class="ajaxtag hide-if-no-js">
</span><span class="cx">                 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
</span><span class="cx">                 <div class="taghint"><?php echo $help_hint; ?></div>
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx">         </div>
</span><span class="cx">         <div class="tagchecklist"></div>
</span><span class="cx"> </div>
</span><del>-<?php if ( current_user_can($taxonomy->assign_cap) ) : ?>
</del><ins>+<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
</ins><span class="cx"> <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( $help_cloud, $box['title'] ); ?></a></p>
</span><span class="cx"> <?php else : ?>
</span><span class="cx"> <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
</span><span class="lines">@@ -315,10 +315,10 @@
</span><span class="cx">                                 <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
</span><span class="cx">                         </ul>
</span><span class="cx">                 </div>
</span><del>-        <?php if ( !current_user_can($tax->assign_cap) ) : ?>
</del><ins>+        <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
</ins><span class="cx">         <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
</span><span class="cx">         <?php endif; ?>
</span><del>-        <?php if ( current_user_can($tax->edit_cap) ) : ?>
</del><ins>+        <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
</ins><span class="cx">                         <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
</span><span class="cx">                                 <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>
</span><span class="cx">                                 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child">
</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]) && current_user_can( $taxonomy_obj->assign_cap ) )
</del><ins>+                        if( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->cap->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->edit_cap ) )
</del><ins>+        if ( ! current_user_can( $tax->cap->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' => $taxonomy);
</span><span class="cx">
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><del>-        $args['disabled'] = !current_user_can($tax->assign_cap);
</del><ins>+        $args['disabled'] = !current_user_can($tax->cap->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' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );
</span><span class="cx">
</span><span class="cx">         $tax = get_taxonomy($taxonomy);
</span><del>-        if ( ! current_user_can($tax->assign_cap) )
</del><ins>+        if ( ! current_user_can($tax->cap->assign_terms) )
</ins><span class="cx">                 $disabled = 'disabled="disabled"';
</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->delete_cap) && $tag->term_id != $default_term )
</del><ins>+                                        if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term )
</ins><span class="cx">                                                 $out .= '<th scope="row" class="check-column"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></th>';
</span><span class="cx">                                         else
</span><span class="cx">                                                 $out .= '<th scope="row" class="check-column">&nbsp;</th>';
</span><span class="lines">@@ -444,11 +444,11 @@
</span><span class="cx">                                 case 'name':
</span><span class="cx">                                         $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $name)) . '">' . $name . '</a></strong><br />';
</span><span class="cx">                                         $actions = array();
</span><del>-                                        if ( current_user_can($tax->edit_cap) ) {
</del><ins>+                                        if ( current_user_can($tax->cap->edit_terms) ) {
</ins><span class="cx">                                                 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
</span><span class="cx">                                                 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
</span><span class="cx">                                         }
</span><del>-                                        if ( current_user_can($tax->delete_cap) && $tag->term_id != $default_term )
</del><ins>+                                        if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term )
</ins><span class="cx">                                                 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";
</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->show_ui || ! in_array('post', (array) $tax->object_type, true) )
</span><span class="cx">                         continue;
</span><span class="cx">
</span><del>-                $submenu['edit.php'][$i++] = array( esc_attr($tax->label), $tax->manage_cap, 'edit-tags.php?taxonomy=' . $tax->name );
</del><ins>+                $submenu['edit.php'][$i++] = array( esc_attr($tax->label), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->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->show_ui || ! in_array($ptype, (array) $tax->object_type, true) )
</span><span class="cx">                         continue;
</span><span class="cx">
</span><del>-                $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label), $tax->manage_cap, "edit-tags.php?taxonomy=$tax->name&amp;post_type=$ptype" );
</del><ins>+                $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&amp;post_type=$ptype" );
</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">                                                 </ul>
</span><span class="cx">                                         </div>
</span><span class="cx">
</span><del>-                                        <?php if ( !current_user_can($tax->assign_cap) ) : ?>
</del><ins>+                                        <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
</ins><span class="cx">                                         <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
</span><span class="cx">                                         <?php endif; ?>
</span><del>-                                        <?php if ( current_user_can($tax->edit_cap) ) : ?>
</del><ins>+                                        <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
</ins><span class="cx">                                                 <div id="category-adder" class="wp-hidden-children">
</span><span class="cx">                                                         <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>
</span><span class="cx">                                                         <p id="category-add" class="category-add wp-hidden-child">
</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->manage_cap) || current_user_can($tags->manage_cap) ) : ?>
</del><ins>+if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
</ins><span class="cx"> <div class="tool-box">
</span><span class="cx"> <h3 class="title"><?php _e('Category&#47;Tag Conversion') ?></h3>
</span><span class="cx"> <p><?php printf(__('Use this to convert <a href="%s">categories to tags</a>, or <a href="%s">tags to categories</a>.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&amp;step=3'); ?></p>
</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->edit_cap) )
</del><ins>+        if ( !current_user_can($tax->cap->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->edit_cap) )
</del><ins>+        if ( !current_user_can($tax->cap->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->assign_cap) )
</del><ins>+                        if ( current_user_can($taxonomy_obj->cap->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' => null,
</span><span class="cx">                                                 'label' => null,
</span><span class="cx">                                                 'show_tagcloud' => null,
</span><del>-                                                '_builtin' => false
</del><ins>+                                                '_builtin' => false,
+                                                'capabilities' => 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' => 'manage_categories',
+                'edit_terms' => 'manage_categories',
+                'delete_terms' => 'manage_categories',
+                'assign_terms' => '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>