kontrivemedia
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: WP Super Edit] Disable the HTML tab?HOW TO: REMOVE HTML MODE for WordPress User Roles
The following change to the WordPress code will allow you to control which user roles have the ability to view the HTML mode when editing content. After the code has been changed – this exact code will only allow Admin users to use the HTML and Visual Mode. All other users will be limited to Visual Mode Only.
——————————–WordPress is a great CMS tool.
I also wanted to add additional control over what each user is able to change within the admin. The above mentioned CSS solutions did not work for me nor did they seem like a clean solution.The clean and simple way to add user level control over this feature is the following:
Find: wp-includes/general-template.php
Find:
<a id="edButtonHTML" onclick="switchEditors.go('<?php echo $id; ?>', 'html');"><?php _e('HTML'); ?></a>It will be located around line: 1506
Replace: `<?php if ( current_user_can(‘level_10’) ) { ?>
‘, ‘html’);”><?php _e(‘HTML’); ?>
<?php } ?>`Similar code can be found in: wp-admin/press-this.php
It is not a requirement to make changes in this document.I hope this solution helps the development community. It would be nice if someone would convert this into a plugin with additional controls.
Visit us online: http://www.kontrive.com