{"id":2276456,"date":"2011-09-02T10:38:53","date_gmt":"2011-09-02T10:38:53","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/edit_plugins-capability\/"},"modified":"2016-08-20T02:15:41","modified_gmt":"2016-08-20T02:15:41","slug":"edit_plugins-capability","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/edit_plugins-capability\/","title":{"rendered":"edit_plugins capability"},"content":{"rendered":"<p>I like to include this line in wp-config.php:<\/p>\n<p><code>define( &#039;DISALLOW_FILE_EDIT&#039;, true );<\/code><\/p>\n<p>To easily, globally disable theme and plugin editing, which I never have a use for, and is potentially risky.<\/p>\n<p>Unfortunately, some plugins use the <code>edit_plugins<\/code> capability (which is removed by the above setting) as a kind of &#8220;is this user an admin?&#8221; test. I think this is a bad idea generally &#8211; something less likely to be disabled, such as <code>update_core<\/code> or <code>manage_options<\/code>, should be used to test for admins.<\/p>\n<p>I&#8217;ve just discovered that Plugin Notes (which I love!) also uses this capability. Now, I can see a little logic in this choice, unlike with other plugins using this as a test. Still, by adding a note to a plugin you&#8217;re not really &#8220;editing&#8221; the plugin at all. Is there any reason to not use another admin-only capability? There&#8217;s quite a few that are just as or more appropriate than <code>edit_plugins<\/code>, and which I don&#8217;t think are as likely to be disabled by something like the above setting.<\/p>\n","protected":false},"template":"","class_list":["post-2276456","topic","type-topic","status-closed","hentry","topic-tag-capabilities"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2276456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2276456\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2276456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}