Make WordPress Core

Changeset 16713


Ignore:
Timestamp:
12/03/2010 11:18:02 PM (14 years ago)
Author:
scribu
Message:

Check correct cap in WP_Terms_List_Table::check_permissions. Props duck_. Fixes #15673

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r16579 r16713  
    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    }
Note: See TracChangeset for help on using the changeset viewer.