From 4fae1f64c28cea3f103b77010e51670aa7b0bed6 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 19 Apr 2012 14:05:05 +0000 Subject: [PATCH] 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: http://svn.automattic.com/wordpress/trunk@20534 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/capabilities.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 19568e5dc..962e2128b 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -1124,6 +1124,13 @@ function map_meta_cap( $cap, $user_id ) { else $caps[] = 'do_not_allow'; 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_plugins': case 'edit_themes': @@ -1146,13 +1153,6 @@ function map_meta_cap( $cap, $user_id ) { break; } // 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_users': // If multisite these caps are allowed only for super admins.