Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to remove the edit option for all plugins on a wordpress site. Is there a hook/filter for doing this? It would be preferred to do it from the theme's functions file, rather than try to disable it within each plugin. Ideally, it could be removed for users without admin privileges, but that is a secondary concern.

enter image description here

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Add the following line to your WordPress installs wp-config.php

define('DISALLOW_FILE_EDIT',true);
share|improve this answer
    
That did it! Awesome. However, due to the version control setup we have, I would still prefer to do it within the theme functions. And the good news is, you can put this code there instead, and it still works! Merci! –  Starfs May 11 '12 at 14:49
    
Yup, you can set wordpress constants elsewhere as well. wp-config.php simply is the default location where you'd do so. If within the theme seems to be a better fit for your case, I don't see why you shouldn't set it there. You can wrap it in conditionals (user role) there as well. –  Johannes Pille May 11 '12 at 14:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.