Occasionally you may wish to disable the plugin or theme editor to prevent WordPress site users from being able to edit sensitive files and potentially crash the site.
To disable editing the theme and the plugins use:
define( 'DISALLOW_FILE_EDIT', true );
Note: The functionality of some plugins may be affected by the use of
current_user_can('edit_plugins') in their code. Plugin authors should avoid checking for this capability, or at least check if this constant is set and display an appropriate error message. Be aware that if a plugin is not working this may be the cause.