Hi @fendove,
That’s happening because, by default, in WordPress, site administrators in a WordPress multisite install don’t have the “unfiltered_html” capability.
WPCode simply checks and respects that capability and has done so from the first version so this is not new. You can use a plugin like https://ww.wp.xz.cn/plugins/user-role-editor/ if you want to change that but please be aware of the implications of this change.
You can read more about this capability here: https://ww.wp.xz.cn/documentation/article/roles-and-capabilities/#unfiltered_html
Our Admins have already been given unfiltered_html capabilities. They were previously able to use this plugin and suddenly are not.
Hi @fendove,
We have not made any changes to the way those permissions work in a while so if you have not updated WPCode recently I suspect those permissions might have been reset somehow?
Do you have a plugin to manage capabilites that you can use to check if your administrator users still have the unfiltered_html capability?
I checked it before replying to you, just in case.
Hi @fendove,
Yes, I can see the issue, the problem is that the unfiltered_html capability is disabled for multisite networks. I’m not sure how it worked for you previously but one way to enable it is to use WPCode to add a snippet on the site where you want to enable the capability for the administrator.
Here’s an example of the code you can use:
add_filter( 'map_meta_cap', function( $caps, $cap, $user_id ){
if ( 'unfiltered_html' === $cap && user_can( $user_id, 'administrator' ) ) {
$caps = [ 'unfiltered_html' ];
}
return $caps;
}, 1, 3 );