Changeset 12967
- Timestamp:
- 02/05/2010 02:33:29 PM (15 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/meta-boxes.php
r12833 r12967 240 240 $tax_name = esc_attr(substr($box['id'], 8)); 241 241 $taxonomy = get_taxonomy($tax_name); 242 if ( !current_user_can($taxonomy->manage_cap) ) 242 if ( !current_user_can($taxonomy->manage_cap) ) // @todo: Display the terms, do not edit. 243 243 return; 244 244 $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.'); … … 280 280 $tax = get_taxonomy($taxonomy); 281 281 282 if ( !current_user_can($tax->manage_cap) )283 return;284 282 ?> 285 283 <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv"> … … 297 295 <div id="<?php echo $taxonomy; ?>-all" class="tabs-panel"> 298 296 <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear"> 299 <?php wp_terms_checklist($post->ID, array( 'taxonomy'=>$taxonomy, 'popular_cats'=> $popular_ids)) ?>297 <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?> 300 298 </ul> 301 299 </div> -
trunk/wp-admin/includes/template.php
r12966 r12967 475 475 476 476 $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; 477 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';477 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . (!empty($args['disabled']) ? 'disabled="disabled"' : '') . '/> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>'; 478 478 } 479 479 … … 529 529 $args = array('taxonomy' => $taxonomy); 530 530 531 $tax = get_taxonomy($taxonomy); 532 $args['disabled'] = !current_user_can($tax->manage_cap); 533 531 534 if ( is_array( $selected_cats ) ) 532 535 $args['selected_cats'] = $selected_cats; … … 588 591 589 592 $terms = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); 593 594 $tax = get_taxonomy($taxonomy); 595 if ( ! current_user_can($tax->manage_cap) ) 596 $disabled = 'disabled="disabled"'; 597 else 598 $disabled = ''; 590 599 591 600 $popular_ids = array(); … … 600 609 <li id="<?php echo $id; ?>" class="popular-category"> 601 610 <label class="selectit"> 602 <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" />611 <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php echo $disabled ?>/> 603 612 <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?> 604 613 </label>
Note: See TracChangeset
for help on using the changeset viewer.