Ticket #19712: meta-boxes.2.diff
File meta-boxes.2.diff, 3.3 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
268 268 * @since 2.6.0 269 269 * 270 270 * @param object $post 271 * @param array $box associative array 271 272 */ 272 273 function post_tags_meta_box($post, $box) { 273 $defaults = array( 'taxonomy' => 'post_tag');274 if ( ! isset($box['args']) || !is_array($box['args']) )274 $defaults = array( 'taxonomy' => 'post_tag' ); 275 if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) 275 276 $args = array(); 276 277 else 277 278 $args = $box['args']; 278 279 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); 279 280 $tax_name = esc_attr($taxonomy); 280 281 $taxonomy = get_taxonomy($taxonomy); 281 $ disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';282 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); 282 283 ?> 283 284 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> 284 285 <div class="jaxtag"> 285 286 <div class="nojs-tags hide-if-js"> 286 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> 287 <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 get_terms_to_edit( $post->ID, $tax_name ); // textarea_escaped by esc_attr() ?></textarea></div> 288 <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?> 287 <p><?php echo esc_html( $taxonomy->labels->add_or_remove_items ); ?></p> 288 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo get_terms_to_edit( $post->ID, $tax_name ); // textarea_escaped by esc_attr() ?></textarea> 289 </div> 290 <?php if ( $user_can_assign_terms ) : ?> 289 291 <div class="ajaxtag hide-if-no-js"> 290 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>291 <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div>292 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo esc_html( $box['title'] ); ?></label> 293 <div class="taghint"><?php echo esc_html( $taxonomy->labels->add_new_item ); ?></div> 292 294 <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="" /> 293 295 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p> 294 296 </div> 295 <p class="howto"><?php echo esc_ attr( $taxonomy->labels->separate_items_with_commas ); ?></p>297 <p class="howto"><?php echo esc_html( $taxonomy->labels->separate_items_with_commas ); ?></p> 296 298 <?php endif; ?> 297 299 </div> 298 300 <div class="tagchecklist"></div> 299 301 </div> 300 <?php if ( current_user_can($taxonomy->cap->assign_terms)) : ?>301 <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>302 <?php if ( $user_can_assign_terms ) : ?> 303 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo esc_html( $taxonomy->labels->choose_from_most_used ); ?></a></p> 302 304 <?php endif; ?> 303 305 <?php 304 306 }