Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Block Visual and Text Tabs › Reply To: Block Visual and Text Tabs
19/08/2015 at 08:11
#1662
Vladimir
Keymaster
Hi,
This code removes all HTML tags from the post content before save it for all users with ‘author’ role:
add_filter('content_save_pre', 'nohtml_in_posts');
function nohtml_in_posts($content) {
if (current_user_can('author')) {
$content = wp_filter_nohtml_kses($content);
}
return $content;
}
Include it into active theme’s functions.php file.