WordPress.org

Make WordPress Core

Ticket #15673: 15673.diff

File 15673.diff, 704 bytes (added by duck_, 7 years ago)
  • wp-admin/includes/class-wp-terms-list-table.php

     
    3232                ) );
    3333        }
    3434
    35         function check_permissions( $type = 'manage' ) {
     35        function check_permissions( $type = '' ) {
    3636                global $tax;
    3737
    38                 $cap = 'manage' == $type ? $tax->cap->manage_terms : $tax->cap->edit_terms;
    39 
    40                 if ( !current_user_can( $tax->cap->manage_terms ) )
     38                $cap = 'edit' == $type ? $tax->cap->edit_terms : $tax->cap->manage_terms;
     39                if ( !current_user_can( $cap ) )
    4140                        wp_die( __( 'Cheatin’ uh?' ) );
    4241        }
    4342