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

git-svn-id: https://develop.svn.wordpress.org/trunk@16713 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu 2010-12-03 23:18:02 +00:00
parent b4ff753679
commit a01db8b692

View File

@ -32,12 +32,11 @@ class WP_Terms_List_Table extends WP_List_Table {
) ); ) );
} }
function check_permissions( $type = 'manage' ) { function check_permissions( $type = '' ) {
global $tax; global $tax;
$cap = 'manage' == $type ? $tax->cap->manage_terms : $tax->cap->edit_terms; $cap = 'edit' == $type ? $tax->cap->edit_terms : $tax->cap->manage_terms;
if ( !current_user_can( $cap ) )
if ( !current_user_can( $tax->cap->manage_terms ) )
wp_die( __( 'Cheatin’ uh?' ) ); wp_die( __( 'Cheatin’ uh?' ) );
} }