1

I tried searching and going crazy looking for this, where did the ability to edit a plugin go in WordPress? I am using WordPress 4.7.2, logged in as an administrator and I can't find where to edit a plugin!

Previously I could go to Plugins and click Edit next to the plugin I wanted to change OR I could select Plugins and open Editor. Neither option is there for me anymore?

I used this occasionally when on the road and not in front of an FTP client to make small tweaks.

enter image description here

Thank you

  • 1
    Is this a multisite installation? If so, then the editor is in My Sites > Network Admin > (Plugins | Themes) > Editor. If not, then the only reason I can think of is that something (plugin or theme) has hooked into the user_has_cap filter and removed the edit_plugin cap for the administrator account. – Paul 'Sparrow Hawk' Biron Feb 25 '17 at 16:17
  • @Paul'SparrowHawk'Biron I am using the default theme on single site – AAA Feb 25 '17 at 16:20
  • 1
    then try deactivating plugins, on at a time, and see if the editor comes back. When/if it does, you'll know which plugin has removed the cap. If that doesn't identify the problem, then I'm at a loss. – Paul 'Sparrow Hawk' Biron Feb 25 '17 at 16:28
  • Thank you @Paul'SparrowHawk'Biron that was it! The plugin causing this issue was: iThemes Security (coincidently, I have had other issues where the plugin took up 60gb of repetitive backups recently even though it was set NOT to). Do you want to submit as an answer and I will mark as the solution? – AAA Feb 25 '17 at 18:03
1

I suspect some plugin is hooking into the user_has_cap filter and removing the edit_plugin cap for the administrator account.

To find out if this is the case, try deactivating plugins, one at a time, and see if the editor comes back. When/if it does, you'll know which plugin has removed the cap.

Edit:

What you do once you find the plugin in question is a different matter. If the plugin is vital to the functioning of your site, then see if it has a setting where you can tell it not to remove the edit_{plugin,theme} capability.

If it doesn't, then do NOT edit the source of the plugin to fix the problem (because your edit will get lost when/if that plugin's author updates it). Instead, you can simply hook into user_has_cap yourself (in a plugin or theme you control) and add the cap back in. If you do this, make sure you are hooking in with a higher priority than the plugin in question is using, e.g., add_filter ('user_has_cap', 'your_func', 99999, 4) ;. See user_has_cap and add_filter() for more info on how to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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