<!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>[12833] trunk: First scratch at Taxonomy Capabilities.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12833">12833</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-01-26 11:32:04 +0000 (Tue, 26 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>First scratch at Taxonomy Capabilities. See <a href="http://trac.wordpress.org/ticket/12035">#12035</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadmineditformadvancedphp">trunk/wp-admin/edit-form-advanced.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="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.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 (12832 => 12833)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-01-26 06:53:47 UTC (rev 12832)
+++ trunk/wp-admin/admin-ajax.php        2010-01-26 11:32:04 UTC (rev 12833)
</span><span class="lines">@@ -204,7 +204,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( 'manage_categories' ) )
</del><ins>+        if ( !current_user_can( $taxonomy-&gt;manage_cap ) )
</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">@@ -329,11 +329,13 @@
</span><span class="cx"> case 'delete-tag' :
</span><span class="cx">         $tag_id = (int) $_POST['tag_ID'];
</span><span class="cx">         check_ajax_referer( &quot;delete-tag_$tag_id&quot; );
</span><del>-        if ( !current_user_can( 'manage_categories' ) )
-                die('-1');
</del><span class="cx"> 
</span><span class="cx">         $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
</span><ins>+        $tax = get_taxonomy($taxonomy);
</ins><span class="cx"> 
</span><ins>+        if ( !current_user_can( $tax-&gt;delete_cap ) )
+                die('-1');
+
</ins><span class="cx">         $tag = get_term( $tag_id, $taxonomy );
</span><span class="cx">         if ( !$tag || is_wp_error( $tag ) )
</span><span class="cx">                 die('1');
</span><span class="lines">@@ -599,10 +601,13 @@
</span><span class="cx">         break;
</span><span class="cx"> case 'add-tag' : // From Manage-&gt;Tags
</span><span class="cx">         check_ajax_referer( 'add-tag' );
</span><del>-        if ( !current_user_can( 'manage_categories' ) )
</del><ins>+
+        $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
+        $tax = get_taxonomy($taxonomy);
+
+        if ( !current_user_can( $tax-&gt;edit_cap ) )
</ins><span class="cx">                 die('-1');
</span><span class="cx"> 
</span><del>-        $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
</del><span class="cx">         $tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
</span><span class="cx"> 
</span><span class="cx">         if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
</span><span class="lines">@@ -1175,8 +1180,13 @@
</span><span class="cx"> case 'inline-save-tax':
</span><span class="cx">         check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
</span><span class="cx"> 
</span><del>-        if ( ! current_user_can('manage_categories') )
</del><ins>+        $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : false;
+        if ( ! $taxonomy )
</ins><span class="cx">                 die( __('Cheatin&amp;#8217; uh?') );
</span><ins>+        $tax = get_taxonomy($taxonomy);
+                
+        if ( ! current_user_can( $tax-&gt;edit_cap ) )
+                die( __('Cheatin&amp;#8217; uh?') );
</ins><span class="cx"> 
</span><span class="cx">         if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
</span><span class="cx">                 die(-1);
</span></span></pre></div>
<a id="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (12832 => 12833)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2010-01-26 06:53:47 UTC (rev 12832)
+++ trunk/wp-admin/edit-form-advanced.php        2010-01-26 11:32:04 UTC (rev 12833)
</span><span class="lines">@@ -97,10 +97,13 @@
</span><span class="cx">         $taxonomy = get_taxonomy($tax_name);
</span><span class="cx">         $label = isset($taxonomy-&gt;label) ? esc_attr($taxonomy-&gt;label) : $tax_name;
</span><span class="cx"> 
</span><ins>+        if ( !current_user_can($taxonomy-&gt;manage_cap) )
+                continue;
+
</ins><span class="cx">         if ( !is_taxonomy_hierarchical($tax_name) )
</span><span class="cx">                 add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core');
</span><span class="cx">         else
</span><del>-                add_meta_box($tax_name.'div', $label, 'post_categories_meta_box', 'post', 'side', 'core', array( 'taxonomy' =&gt; $tax_name ));
</del><ins>+                add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', 'post', 'side', 'core', array( 'taxonomy' =&gt; $tax_name ));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if ( post_type_supports($post_type, 'page-attributes') )
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (12832 => 12833)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-01-26 06:53:47 UTC (rev 12832)
+++ trunk/wp-admin/edit-tags.php        2010-01-26 11:32:04 UTC (rev 12833)
</span><span class="lines">@@ -19,6 +19,8 @@
</span><span class="cx"> if ( !is_taxonomy($taxonomy) )
</span><span class="cx">         wp_die(__('Invalid taxonomy'));
</span><span class="cx"> 
</span><ins>+$tax = get_taxonomy($taxonomy);
+
</ins><span class="cx"> if ( empty($post_type) || !in_array( $post_type, get_post_types( array('_show' =&gt; true) ) ) )
</span><span class="cx">         $post_type = 'post';
</span><span class="cx"> 
</span><span class="lines">@@ -39,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('manage_categories') )
</del><ins>+        if ( !current_user_can($tax-&gt;edit_cap) )
</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">@@ -60,7 +62,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('manage_categories') )
</del><ins>+        if ( !current_user_can($tax-&gt;delete_cap) )
</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">@@ -80,7 +82,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('manage_categories') )
</del><ins>+        if ( !current_user_can($tax-&gt;delete_cap) )
</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">@@ -115,7 +117,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('manage_categories') )
</del><ins>+        if ( !current_user_can($tax-&gt;edit_cap) )
</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">@@ -142,10 +144,8 @@
</span><span class="cx">          exit;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-$can_manage = current_user_can('manage_categories');
-
</del><span class="cx"> wp_enqueue_script('admin-tags');
</span><del>-if ( $can_manage )
</del><ins>+if ( current_user_can($tax-&gt;edit_cap) )
</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">@@ -249,10 +249,7 @@
</span><span class="cx">         &lt;/tfoot&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;tbody id=&quot;the-list&quot; class=&quot;list:tag&quot;&gt;
</span><del>-&lt;?php
-
-$count = tag_rows( $pagenum, $tags_per_page, $searchterms, $taxonomy );
-?&gt;
</del><ins>+&lt;?php tag_rows( $pagenum, $tags_per_page, $searchterms, $taxonomy ); ?&gt;
</ins><span class="cx">         &lt;/tbody&gt;
</span><span class="cx"> &lt;/table&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -284,15 +281,15 @@
</span><span class="cx"> &lt;div class=&quot;tagcloud&quot;&gt;
</span><span class="cx"> &lt;h3&gt;&lt;?php _e('Popular Tags'); ?&gt;&lt;/h3&gt;
</span><span class="cx"> &lt;?php
</span><del>-if ( $can_manage )
</del><ins>+if ( current_user_can($tax-&gt;edit_cap) )
</ins><span class="cx">         wp_tag_cloud(array('taxonomy' =&gt; $taxonomy, 'link' =&gt; 'edit'));
</span><span class="cx"> else
</span><span class="cx">         wp_tag_cloud(array('taxonomy' =&gt; $taxonomy));
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( $can_manage ) {
-        do_action('add_tag_form_pre'); ?&gt;
</del><ins>+&lt;?php if ( current_user_can($tax-&gt;edit_cap) ) {
+        do_action('add_tag_form_pre', $taxonomy); ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;form-wrap&quot;&gt;
</span><span class="cx"> &lt;h3&gt;&lt;?php _e('Add a New Tag'); ?&gt;&lt;/h3&gt;
</span><span class="lines">@@ -327,7 +324,7 @@
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; id=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Add Tag'); ?&gt;&quot; /&gt;&lt;/p&gt;
</span><del>-&lt;?php do_action('add_tag_form'); ?&gt;
</del><ins>+&lt;?php do_action('add_tag_form', $taxonomy); ?&gt;
</ins><span class="cx"> &lt;/form&gt;&lt;/div&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (12832 => 12833)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2010-01-26 06:53:47 UTC (rev 12832)
+++ trunk/wp-admin/includes/meta-boxes.php        2010-01-26 11:32:04 UTC (rev 12833)
</span><span class="lines">@@ -239,6 +239,8 @@
</span><span class="cx"> function post_tags_meta_box($post, $box) {
</span><span class="cx">         $tax_name = esc_attr(substr($box['id'], 8));
</span><span class="cx">         $taxonomy = get_taxonomy($tax_name);
</span><ins>+        if ( !current_user_can($taxonomy-&gt;manage_cap) )
+                return;
</ins><span class="cx">         $helps = isset($taxonomy-&gt;helps) ? esc_attr($taxonomy-&gt;helps) : __('Separate tags with commas.');
</span><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="lines">@@ -275,6 +277,10 @@
</span><span class="cx">         else
</span><span class="cx">                 $args = $box['args'];
</span><span class="cx">          extract( wp_parse_args($args, $defaults), EXTR_SKIP );
</span><ins>+        $tax = get_taxonomy($taxonomy);
+
+        if ( !current_user_can($tax-&gt;manage_cap) )
+                return;
</ins><span class="cx">          ?&gt;
</span><span class="cx">          &lt;div id=&quot;taxonomy-&lt;?php echo $taxonomy; ?&gt;&quot; class=&quot;categorydiv&quot;&gt;
</span><span class="cx">                  &lt;ul id=&quot;&lt;?php echo $taxonomy; ?&gt;-tabs&quot; class=&quot;category-tabs&quot;&gt;
</span><span class="lines">@@ -294,7 +300,7 @@
</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('manage_categories') ) : ?&gt;
</del><ins>+    &lt;?php if ( current_user_can($tax-&gt;edit_cap) ) : ?&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 _e( '+ Add New Category' ); ?&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="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (12832 => 12833)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-01-26 06:53:47 UTC (rev 12832)
+++ trunk/wp-admin/includes/template.php        2010-01-26 11:32:04 UTC (rev 12833)
</span><span class="lines">@@ -211,7 +211,8 @@
</span><span class="cx">  */
</span><span class="cx"> function inline_edit_term_row($type, $taxonomy) {
</span><span class="cx"> 
</span><del>-        if ( ! current_user_can( 'manage_categories' ) )
</del><ins>+        $tax = get_taxonomy($taxonomy);
+        if ( ! current_user_can( $tax-&gt;edit_cap ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         $columns = get_column_headers($type);
</span><span class="lines">@@ -678,16 +679,22 @@
</span><span class="cx">                         $tagsel = 'category_name';
</span><span class="cx">                 else
</span><span class="cx">                         $tagsel = $taxonomy;
</span><ins>+
+                $tax = get_taxonomy($taxonomy);
+
</ins><span class="cx">                 $count = ( $count &gt; 0 ) ? &quot;&lt;a href='edit.php?$tagsel=$tag-&gt;slug'&gt;$count&lt;/a&gt;&quot; : $count;
</span><span class="cx"> 
</span><span class="cx">                 $pad = str_repeat( '&amp;#8212; ', max(0, $level) );
</span><span class="cx">                 $name = apply_filters( 'term_name', $pad . ' ' . $tag-&gt;name );
</span><span class="cx">                 $qe_data = get_term($tag-&gt;term_id, $taxonomy, object, 'edit');
</span><span class="cx">                 $edit_link = &quot;edit-tags.php?action=edit&amp;amp;taxonomy=$taxonomy&amp;amp;tag_ID=$tag-&gt;term_id&quot;;
</span><ins>+
</ins><span class="cx">                 $out = '';
</span><span class="cx">                 $out .= '&lt;tr id=&quot;tag-' . $tag-&gt;term_id . '&quot;' . $class . '&gt;';
</span><ins>+
</ins><span class="cx">                 $columns = get_column_headers('edit-tags');
</span><span class="cx">                 $hidden = get_hidden_columns('edit-tags');
</span><ins>+                $default_term = get_option('default_' . $taxonomy);
</ins><span class="cx">                 foreach ( $columns as $column_name =&gt; $column_display_name ) {
</span><span class="cx">                         $class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -699,7 +706,7 @@
</span><span class="cx"> 
</span><span class="cx">                         switch ($column_name) {
</span><span class="cx">                                 case 'cb':
</span><del>-                                        if ( $tag-&gt;term_id != get_option('default_' . $taxonomy) )
</del><ins>+                                        if ( current_user_can($tax-&gt;delete_cap) &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">@@ -707,9 +714,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>-                                        $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
-                                        $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
-                                        if ( $tag-&gt;term_id != get_option('default_' . $taxonomy) )
</del><ins>+                                        if ( current_user_can($tax-&gt;edit_cap) ) {
+                                                $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+                                                $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+                                        }
+                                        if ( current_user_can($tax-&gt;delete_cap) &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 class="lines">@@ -746,7 +755,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $out .= '&lt;/tr&gt;';
</del><ins>+                $out .= &quot;&lt;/tr&gt;\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">                 return $out;
</span><span class="cx"> }
</span><span class="lines">@@ -795,7 +804,6 @@
</span><span class="cx">                         $out .= _tag_row( $term, 0, ++$count % 2 ? ' class=&quot;alternate&quot;' : '', $taxonomy );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        // filter and send to screen
</del><span class="cx">         echo $out;
</span><span class="cx">         return $count;
</span><span class="cx"> }
</span><span class="lines">@@ -1135,7 +1143,7 @@
</span><span class="cx">         ?&gt;&quot; style=&quot;display: none&quot;&gt;&lt;td colspan=&quot;&lt;?php echo $col_count; ?&gt;&quot;&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;fieldset class=&quot;inline-edit-col-left&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
</span><del>-                &lt;h4&gt;&lt;?php echo $bulk ? ( __( 'Bulk Edit' ) ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
</del><ins>+                &lt;h4&gt;&lt;?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> &lt;?php if ( $bulk ) : ?&gt;
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (12832 => 12833)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-01-26 06:53:47 UTC (rev 12832)
+++ trunk/wp-includes/taxonomy.php        2010-01-26 11:32:04 UTC (rev 12833)
</span><span class="lines">@@ -15,9 +15,27 @@
</span><span class="cx">  * Creates the initial taxonomies when 'init' action is fired.
</span><span class="cx">  */
</span><span class="cx"> function create_initial_taxonomies() {
</span><del>-        register_taxonomy( 'category', 'post', array('hierarchical' =&gt; true, 'update_count_callback' =&gt; '_update_post_term_count', 'label' =&gt; __('Categories'), 'query_var' =&gt; false, 'rewrite' =&gt; false) ) ;
-        register_taxonomy( 'post_tag', 'post', array('hierarchical' =&gt; false, 'update_count_callback' =&gt; '_update_post_term_count', 'label' =&gt; __('Post Tags'), 'query_var' =&gt; false, 'rewrite' =&gt; false) ) ;
-        register_taxonomy( 'link_category', 'link', array('hierarchical' =&gt; false, 'label' =&gt; __('Categories'), 'query_var' =&gt; false, 'rewrite' =&gt; false) ) ;
</del><ins>+        register_taxonomy( 'category', 'post', array(        'hierarchical' =&gt; true,
+                                                                                                         'update_count_callback' =&gt; '_update_post_term_count',
+                                                                                                        'label' =&gt; __('Categories'),
+                                                                                                        'query_var' =&gt; false,
+                                                                                                        'rewrite' =&gt; false,
+                                                                                                        'edit_cap' =&gt; 'no_priv'
+                                                                                                ) ) ;
+
+        register_taxonomy( 'post_tag', 'post', array(
+                                                                                                         'hierarchical' =&gt; false,
+                                                                                                        'update_count_callback' =&gt; '_update_post_term_count',
+                                                                                                        'label' =&gt; __('Post Tags'),
+                                                                                                        'query_var' =&gt; false,
+                                                                                                        'rewrite' =&gt; false
+                                                                                                ) ) ;
+
+        register_taxonomy( 'link_category', 'link', array(        'hierarchical' =&gt; false,
+                                                                                                                  'label' =&gt; __('Categories'),
+                                                                                                                'query_var' =&gt; false,
+                                                                                                                'rewrite' =&gt; false
+                                                                                                        ) ) ;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
</span><span class="cx"> 
</span><span class="lines">@@ -167,7 +185,7 @@
</span><span class="cx"> function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
</span><span class="cx">         global $wp_taxonomies, $wp_rewrite, $wp;
</span><span class="cx"> 
</span><del>-        if (!is_array($wp_taxonomies))
</del><ins>+        if ( ! is_array($wp_taxonomies) )
</ins><span class="cx">                 $wp_taxonomies = array();
</span><span class="cx"> 
</span><span class="cx">         $defaults = array('hierarchical' =&gt; false, 'update_count_callback' =&gt; '', 'rewrite' =&gt; true, 'query_var' =&gt; true);
</span><span class="lines">@@ -191,6 +209,11 @@
</span><span class="cx">                 $wp_rewrite-&gt;add_permastruct($taxonomy, &quot;/{$args['rewrite']['slug']}/%$taxonomy%&quot;, $args['rewrite']['with_front']);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) {
+                if ( empty($args[$cap]) )
+                        $args[$cap] = 'manage_categories';
+        }
+
</ins><span class="cx">         $args['name'] = $taxonomy;
</span><span class="cx">         $args['object_type'] = (array) $object_type;
</span><span class="cx">         $wp_taxonomies[$taxonomy] = (object) $args;
</span></span></pre>
</div>
</div>

</body>
</html>