- Timestamp:
- 09/30/2016 10:39:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r38672 r38698 152 152 protected function get_bulk_actions() { 153 153 $actions = array(); 154 $actions['delete'] = __( 'Delete' ); 154 155 if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) { 156 $actions['delete'] = __( 'Delete' ); 157 } 155 158 156 159 return $actions; … … 333 336 */ 334 337 public function column_cb( $tag ) { 335 $default_term = get_option( 'default_' . $this->screen->taxonomy ); 336 337 if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) && $tag->term_id != $default_term ) 338 if ( current_user_can( 'delete_term', $tag->term_id ) ) { 338 339 return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>' 339 340 . '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />'; 341 } 340 342 341 343 return ' '; … … 424 426 $taxonomy = $this->screen->taxonomy; 425 427 $tax = get_taxonomy( $taxonomy ); 426 $default_term = get_option( 'default_' . $taxonomy );427 428 428 $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI']; 429 429 … … 435 435 436 436 $actions = array(); 437 if ( current_user_can( $tax->cap->edit_terms) ) {437 if ( current_user_can( 'edit_term', $tag->term_id ) ) { 438 438 $actions['edit'] = sprintf( 439 439 '<a href="%s" aria-label="%s">%s</a>', … … 450 450 ); 451 451 } 452 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term) {452 if ( current_user_can( 'delete_term', $tag->term_id ) ) { 453 453 $actions['delete'] = sprintf( 454 454 '<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
Note: See TracChangeset
for help on using the changeset viewer.