Check correct cap in WP_Terms_List_Table::check_permissions. Props duck_. Fixes #15673
git-svn-id: http://svn.automattic.com/wordpress/trunk@16713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
67f2b68ed6
commit
ba56c58f44
|
@ -32,12 +32,11 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
) );
|
||||
}
|
||||
|
||||
function check_permissions( $type = 'manage' ) {
|
||||
function check_permissions( $type = '' ) {
|
||||
global $tax;
|
||||
|
||||
$cap = 'manage' == $type ? $tax->cap->manage_terms : $tax->cap->edit_terms;
|
||||
|
||||
if ( !current_user_can( $tax->cap->manage_terms ) )
|
||||
$cap = 'edit' == $type ? $tax->cap->edit_terms : $tax->cap->manage_terms;
|
||||
if ( !current_user_can( $cap ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue