Changeset 12833 for trunk/wp-admin/includes/template.php
- Timestamp:
- 01/26/2010 11:32:04 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r12818 r12833 212 212 function inline_edit_term_row($type, $taxonomy) { 213 213 214 if ( ! current_user_can( 'manage_categories' ) ) 214 $tax = get_taxonomy($taxonomy); 215 if ( ! current_user_can( $tax->edit_cap ) ) 215 216 return; 216 217 … … 679 680 else 680 681 $tagsel = $taxonomy; 682 683 $tax = get_taxonomy($taxonomy); 684 681 685 $count = ( $count > 0 ) ? "<a href='edit.php?$tagsel=$tag->slug'>$count</a>" : $count; 682 686 … … 685 689 $qe_data = get_term($tag->term_id, $taxonomy, object, 'edit'); 686 690 $edit_link = "edit-tags.php?action=edit&taxonomy=$taxonomy&tag_ID=$tag->term_id"; 691 687 692 $out = ''; 688 693 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; 694 689 695 $columns = get_column_headers('edit-tags'); 690 696 $hidden = get_hidden_columns('edit-tags'); 697 $default_term = get_option('default_' . $taxonomy); 691 698 foreach ( $columns as $column_name => $column_display_name ) { 692 699 $class = "class=\"$column_name column-$column_name\""; … … 700 707 switch ($column_name) { 701 708 case 'cb': 702 if ( $tag->term_id != get_option('default_' . $taxonomy))709 if ( current_user_can($tax->delete_cap) && $tag->term_id != $default_term ) 703 710 $out .= '<th scope="row" class="check-column"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></th>'; 704 711 else … … 708 715 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $name)) . '">' . $name . '</a></strong><br />'; 709 716 $actions = array(); 710 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 711 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 712 if ( $tag->term_id != get_option('default_' . $taxonomy) ) 717 if ( current_user_can($tax->edit_cap) ) { 718 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 719 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 720 } 721 if ( current_user_can($tax->delete_cap) && $tag->term_id != $default_term ) 713 722 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>"; 714 723 … … 747 756 } 748 757 749 $out .= '</tr>';758 $out .= "</tr>\n"; 750 759 751 760 return $out; … … 796 805 } 797 806 798 // filter and send to screen799 807 echo $out; 800 808 return $count; … … 1136 1144 1137 1145 <fieldset class="inline-edit-col-left"><div class="inline-edit-col"> 1138 <h4><?php echo $bulk ? ( __( 'Bulk Edit' )) : __( 'Quick Edit' ); ?></h4>1146 <h4><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></h4> 1139 1147 1140 1148
Note: See TracChangeset
for help on using the changeset viewer.