Ticket #23194: 23194.patch
File 23194.patch, 3.6 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
339 339 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); 340 340 $tax_name = esc_attr($taxonomy); 341 341 $taxonomy = get_taxonomy($taxonomy); 342 $ disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';342 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); 343 343 $comma = _x( ',', 'tag delimiter' ); 344 344 ?> 345 345 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> 346 346 <div class="jaxtag"> 347 347 <div class="nojs-tags hide-if-js"> 348 348 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> 349 <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 str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div>350 <?php if ( current_user_can($taxonomy->cap->assign_terms)) : ?>349 <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 str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div> 350 <?php if ( $user_can_assign_terms ) : ?> 351 351 <div class="ajaxtag hide-if-no-js"> 352 352 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> 353 353 <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div> 354 354 <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="" /> 355 355 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p> 356 356 </div> 357 <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p>357 <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> 358 358 <?php endif; ?> 359 359 </div> 360 360 <div class="tagchecklist"></div> 361 361 </div> 362 <?php if ( current_user_can($taxonomy->cap->assign_terms)) : ?>362 <?php if ( $user_can_assign_terms ) : ?> 363 363 <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> 364 364 <?php endif; ?> 365 365 <?php -
wp-admin/includes/template.php
176 176 $terms = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); 177 177 178 178 $tax = get_taxonomy($taxonomy); 179 if ( ! current_user_can($tax->cap->assign_terms) )180 $disabled = 'disabled="disabled"';181 else182 $disabled = '';183 179 184 180 $popular_ids = array(); 185 181 foreach ( (array) $terms as $term ) { … … 192 188 193 189 <li id="<?php echo $id; ?>" class="popular-category"> 194 190 <label class="selectit"> 195 <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php echo $disabled ?>/>191 <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> /> 196 192 <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?> 197 193 </label> 198 194 </li>