<!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>[15190] trunk: Move 'helps' argument to the taxonomy labels object.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15190">15190</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-06-10 16:07:33 +0000 (Thu, 10 Jun 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move 'helps' argument to the taxonomy labels object. Also move over help_nojs and help_cloud, both introduced in 3.0. This adds three new core labels for non-hierarchical taxonomies, for tweaking the meta box strings. fixes <a href="http://trac.wordpress.org/ticket/13805">#13805</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.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="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (15189 => 15190)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2010-06-10 15:28:39 UTC (rev 15189)
+++ trunk/wp-admin/includes/meta-boxes.php        2010-06-10 16:07:33 UTC (rev 15190)
</span><span class="lines">@@ -250,17 +250,12 @@
</span><span class="cx">         extract( wp_parse_args($args, $defaults), EXTR_SKIP );
</span><span class="cx">         $tax_name = esc_attr($taxonomy);
</span><span class="cx">         $taxonomy = get_taxonomy($taxonomy);
</span><del>-
-        $helps      = isset( $taxonomy-&gt;helps      ) ? esc_attr( $taxonomy-&gt;helps ) : esc_attr__('Separate tags with commas.');
-        $help_nojs  = isset( $taxonomy-&gt;help_nojs  ) ? $taxonomy-&gt;help_nojs         : __('Add or remove tags');
-        $help_cloud = isset( $taxonomy-&gt;help_cloud ) ? $taxonomy-&gt;help_cloud        : __('Choose from the most used tags');
-
</del><span class="cx">         $disabled = !current_user_can($taxonomy-&gt;cap-&gt;assign_terms) ? 'disabled=&quot;disabled&quot;' : '';
</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="cx">         &lt;div class=&quot;jaxtag&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;nojs-tags hide-if-js&quot;&gt;
</span><del>-        &lt;p&gt;&lt;?php echo $help_nojs; ?&gt;&lt;/p&gt;
</del><ins>+        &lt;p&gt;&lt;?php echo $taxonomy-&gt;labels-&gt;add_or_remove_items; ?&gt;&lt;/p&gt;
</ins><span class="cx">         &lt;textarea name=&quot;&lt;?php echo &quot;tax_input[$tax_name]&quot;; ?&gt;&quot; rows=&quot;3&quot; cols=&quot;20&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><span class="cx">          &lt;?php if ( current_user_can($taxonomy-&gt;cap-&gt;assign_terms) ) : ?&gt;
</span><span class="cx">         &lt;div class=&quot;ajaxtag hide-if-no-js&quot;&gt;
</span><span class="lines">@@ -269,13 +264,13 @@
</span><span class="cx">                 &lt;p&gt;&lt;input type=&quot;text&quot; id=&quot;new-tag-&lt;?php echo $tax_name; ?&gt;&quot; name=&quot;newtag[&lt;?php echo $tax_name; ?&gt;]&quot; class=&quot;newtag form-input-tip&quot; size=&quot;16&quot; autocomplete=&quot;off&quot; value=&quot;&quot; /&gt;
</span><span class="cx">                 &lt;input type=&quot;button&quot; class=&quot;button tagadd&quot; value=&quot;&lt;?php esc_attr_e('Add'); ?&gt;&quot; tabindex=&quot;3&quot; /&gt;&lt;/p&gt;
</span><span class="cx">         &lt;/div&gt;
</span><del>-        &lt;p class=&quot;howto&quot;&gt;&lt;?php echo $helps; ?&gt;&lt;/p&gt;
</del><ins>+        &lt;p class=&quot;howto&quot;&gt;&lt;?php echo esc_attr( $taxonomy-&gt;labels-&gt;separate_items_with_commas ); ?&gt;&lt;/p&gt;
</ins><span class="cx">         &lt;?php endif; ?&gt;
</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><span class="cx"> &lt;?php if ( current_user_can($taxonomy-&gt;cap-&gt;assign_terms) ) : ?&gt;
</span><del>-&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 echo $help_cloud; ?&gt;&lt;/a&gt;&lt;/p&gt;
</del><ins>+&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 echo $taxonomy-&gt;labels-&gt;choose_from_most_used; ?&gt;&lt;/a&gt;&lt;/p&gt;
</ins><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="cx"> &lt;?php endif; ?&gt;
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (15189 => 15190)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-06-10 15:28:39 UTC (rev 15189)
+++ trunk/wp-includes/post.php        2010-06-10 16:07:33 UTC (rev 15190)
</span><span class="lines">@@ -966,13 +966,11 @@
</span><span class="cx">  */
</span><span class="cx"> function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
</span><span class="cx"> 
</span><del>-        if ( isset( $object-&gt;label ) ) {
</del><ins>+        if ( isset( $object-&gt;label ) &amp;&amp; empty( $object-&gt;labels['name'] ) )
</ins><span class="cx">                 $object-&gt;labels['name'] = $object-&gt;label;
</span><del>-        }
</del><span class="cx"> 
</span><del>-        if ( !isset( $object-&gt;labels['singular_name'] ) &amp;&amp; isset( $object-&gt;labels['name'] ) ) {
</del><ins>+        if ( !isset( $object-&gt;labels['singular_name'] ) &amp;&amp; isset( $object-&gt;labels['name'] ) )
</ins><span class="cx">                 $object-&gt;labels['singular_name'] = $object-&gt;labels['name'];
</span><del>-        }
</del><span class="cx"> 
</span><span class="cx">         $defaults = array_map( create_function( '$x', $object-&gt;hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
</span><span class="cx">         $labels = array_merge( $defaults, $object-&gt;labels );
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (15189 => 15190)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-06-10 15:28:39 UTC (rev 15189)
+++ trunk/wp-includes/taxonomy.php        2010-06-10 16:07:33 UTC (rev 15190)
</span><span class="lines">@@ -334,6 +334,9 @@
</span><span class="cx">  * - update_item - Default is Update Tag/Update Category
</span><span class="cx">  * - add_new_item - Default is Add New Tag/Add New Category
</span><span class="cx">  * - new_item_name - Default is New Tag Name/New Category Name
</span><ins>+ * - separate_items_with_commas - This string isn't used on hierarchical taxonomies. Default is &quot;Separate tags with commas,&quot; used in the meta box.
+ * - add_or_remove_items - This string isn't used on hierarchical taxonomies. Default is &quot;Add or remove tags,&quot; used in the meta box when JavaScript is disabled.
+ * - choose_from_most_used - This string isn't used on hierarchical taxonomies. Default is &quot;Choose from the most used tags,&quot; used in the meta box.
</ins><span class="cx">  *
</span><span class="cx">  * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories.)
</span><span class="cx">  *
</span><span class="lines">@@ -343,6 +346,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> function get_taxonomy_labels( $tax ) {
</span><ins>+        if ( isset( $tax-&gt;helps ) &amp;&amp; empty( $tax-&gt;labels['separate_items_with_commas'] ) )
+                $tax-&gt;labels['separate_items_with_commas'] = $tax-&gt;helps;
+
</ins><span class="cx">         $nohier_vs_hier_defaults = array(
</span><span class="cx">                 'name' =&gt; array( _x( 'Post Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
</span><span class="cx">                 'singular_name' =&gt; array( _x( 'Post Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),
</span><span class="lines">@@ -355,6 +361,9 @@
</span><span class="cx">                 'update_item' =&gt; array( __( 'Update Tag' ), __( 'Update Category' ) ),
</span><span class="cx">                 'add_new_item' =&gt; array( __( 'Add New Tag' ), __( 'Add New Category' ) ),
</span><span class="cx">                 'new_item_name' =&gt; array( __( 'New Tag Name' ), __( 'New Category Name' ) ),
</span><ins>+                'separate_items_with_commas' =&gt; array( __( 'Separate tags with commas' ), null ),
+                'add_or_remove_items' =&gt; array( __( 'Add or remove tags' ), null ),
+                'choose_from_most_used' =&gt; array( __( 'Choose from the most used tags' ), null ),
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         return _get_custom_object_labels( $tax, $nohier_vs_hier_defaults );
</span></span></pre>
</div>
</div>

</body>
</html>