<!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->helps ) ? esc_attr( $taxonomy->helps ) : esc_attr__('Separate tags with commas.');
-        $help_nojs = isset( $taxonomy->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags');
-        $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags');
-
</del><span class="cx">         $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
</span><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><del>-        <p><?php echo $help_nojs; ?></p>
</del><ins>+        <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
</ins><span class="cx">         <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" 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><span class="cx">         <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
</span><span class="cx">         <div class="ajaxtag hide-if-no-js">
</span><span class="lines">@@ -269,13 +264,13 @@
</span><span class="cx">                 <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
</span><span class="cx">                 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p>
</span><span class="cx">         </div>
</span><del>-        <p class="howto"><?php echo $helps; ?></p>
</del><ins>+        <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p>
</ins><span class="cx">         <?php endif; ?>
</span><span class="cx">         </div>
</span><span class="cx">         <div class="tagchecklist"></div>
</span><span class="cx"> </div>
</span><span class="cx"> <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
</span><del>-<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $help_cloud; ?></a></p>
</del><ins>+<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
</ins><span class="cx"> <?php else : ?>
</span><span class="cx"> <p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
</span><span class="cx"> <?php endif; ?>
</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->label ) ) {
</del><ins>+        if ( isset( $object->label ) && empty( $object->labels['name'] ) )
</ins><span class="cx">                 $object->labels['name'] = $object->label;
</span><del>-        }
</del><span class="cx">
</span><del>-        if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) {
</del><ins>+        if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) )
</ins><span class="cx">                 $object->labels['singular_name'] = $object->labels['name'];
</span><del>-        }
</del><span class="cx">
</span><span class="cx">         $defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
</span><span class="cx">         $labels = array_merge( $defaults, $object->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 "Separate tags with commas," used in the meta box.
+ * - add_or_remove_items - This string isn't used on hierarchical taxonomies. Default is "Add or remove tags," used in the meta box when JavaScript is disabled.
+ * - choose_from_most_used - This string isn't used on hierarchical taxonomies. Default is "Choose from the most used tags," 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->helps ) && empty( $tax->labels['separate_items_with_commas'] ) )
+                $tax->labels['separate_items_with_commas'] = $tax->helps;
+
</ins><span class="cx">         $nohier_vs_hier_defaults = array(
</span><span class="cx">                 'name' => array( _x( 'Post Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
</span><span class="cx">                 'singular_name' => 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' => array( __( 'Update Tag' ), __( 'Update Category' ) ),
</span><span class="cx">                 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ),
</span><span class="cx">                 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ),
</span><ins>+                'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ),
+                'add_or_remove_items' => array( __( 'Add or remove tags' ), null ),
+                'choose_from_most_used' => 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>