By default, WordPress allows users to edit theme and plugin codes through the admin panel. While it is a useful feature, it can also be very dangerous. A simple typo can end up banning you from your site unless of course you have FTP access. To prevent customers from messing up the site, it's best to disable theme and plugin editors from the WordPress admin panel. In this article, we will share with you a one-line code that will disable the functionality of WordPress theme and plugin editors.
All you have to do is open your wp-config.php file and paste the following code:
define ('DISALLOW_FILE_EDIT', true);
And you are done.
One of our users pointed out that if you paste this code into the theme's functions.php file, it works too.