Do not block file mod/edit caps when DISALLOW_UNFILTERED_HTML is set. There are separate constants (DISALLOW_FILE_EDIT and DISALLOW_FILE_MODS for those). fixes #20488.
git-svn-id: https://develop.svn.wordpress.org/trunk@20534 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
42437fa97e
commit
29ca3e321a
@ -1124,6 +1124,13 @@ function map_meta_cap( $cap, $user_id ) {
|
|||||||
else
|
else
|
||||||
$caps[] = 'do_not_allow';
|
$caps[] = 'do_not_allow';
|
||||||
break;
|
break;
|
||||||
|
case 'unfiltered_html' :
|
||||||
|
// Disallow unfiltered_html for all users, even admins and super admins.
|
||||||
|
if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML )
|
||||||
|
$caps[] = 'do_not_allow';
|
||||||
|
else
|
||||||
|
$caps[] = $cap;
|
||||||
|
break;
|
||||||
case 'edit_files':
|
case 'edit_files':
|
||||||
case 'edit_plugins':
|
case 'edit_plugins':
|
||||||
case 'edit_themes':
|
case 'edit_themes':
|
||||||
@ -1146,13 +1153,6 @@ function map_meta_cap( $cap, $user_id ) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Fall through if not DISALLOW_FILE_MODS.
|
// Fall through if not DISALLOW_FILE_MODS.
|
||||||
case 'unfiltered_html':
|
|
||||||
// Disallow unfiltered_html for all users, even admins and super admins.
|
|
||||||
if ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) {
|
|
||||||
$caps[] = 'do_not_allow';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Fall through if not DISALLOW_UNFILTERED_HTML
|
|
||||||
case 'delete_user':
|
case 'delete_user':
|
||||||
case 'delete_users':
|
case 'delete_users':
|
||||||
// If multisite these caps are allowed only for super admins.
|
// If multisite these caps are allowed only for super admins.
|
||||||
|
Loading…
Reference in New Issue
Block a user