This should be easiest way, just add the line to wp-config.php, this will disable plugin and theme editor, both.
define('DISALLOW_FILE_EDIT',true);
If you want to add codes into theme’s function, the code should work for you.
function ra_block_tp_edit( $caps, $cap ) {
if($cap == 'edit_plugins' )
$caps[] = 'do_not_allow';
return $caps;
}
add_filter( 'map_meta_cap', 'ra_block_tp_edit', 10, 3 );
Best of luck.
Related Posts:
- Remove specific administrator’s capability
- See which user role / capability is needed to use a plugin
- How to prevent a post from being deleted?
- How can I modify the Capability needed to access a plugin’s options?
- WordPress Capabilities: edit_user vs edit_users
- Allowing Custom Capability to Manage Plugin Options
- WordPress roles – Protect administrator role
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- How create a role with admin capability less 1 or 2?
- Update User Role
- Hook to plugins admin settings
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- How to set add question capability for author role in wp pro quiz plugin
- Is there any way to make myself an admin?
- WordPress permissions error with admin account
- Plugin permissions for Editor role
- How To Create A File Archive in WordPress?
- Adding plugin editing capability for Author
- Remove dashboard links from wordpress
- Disable plugin for administrator
- Why user profile update creates Additional Capabilities
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- Admin page and admin menu. Permissions plugin
- Run only on plug-in activation instead of wp_head
- Defined user role to access plugin’s pages
- Want to add post to user dashboard
- Sync roles across several plugins
- How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
- How to disable plugin capability : “create new category”
- edit slider plugin capability for custom_role
- Best collection of code for your 'functions.php' file [closed]
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- Add section (add_settings_section) to a custom page (add_submenu_page)
- How can I log a user out of WordPress before the page loads?
- Creating button next to “add media” that allows you to choose a single post
- How to assign user a role if none is present when logging in
- Bad Request (Invalid Hostname) on working server, database problem
- Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end
- Is there a simple way to manage capabilities per user?
- How can I change plugin to give access to editor user role?
- Standard permissions for wordpress; Plugin installation asks for FTP credentials
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- Admin Dashboard with Custom Tab for Client
- Why does deactivating a plugin cause error: “You do not have sufficient permissions to access this page”?
- Plugin/Folder permission issues with Azure
- wordpress reusable content blocks
- Remove wordpress author’s capability to moderate comments on their own posts
- Can you set a role as author?
- How to send little data between admin pages of my plugin?
- How to make a customize role and view a specific plugins base on that role?
- Editing admin pages in WordPress [closed]
- Making a plugin only available on the front-end for the logged in super admin
- Admin Panel pagination link styles
- Is this the right way to execute some PHP in my plugin after a button click on an options page?
- How can I force users to a particular subdomain to log in for MU (Multisite)?
- Display update notification messages like ‘What’s New’
- Filter custom posts based on the user role of author
- Custom post type – no layout section of Document tab, and no author choice
- Plugin updates change folder permissions
- How to create restrict content to users (by user, not by role)
- How to create user that has permission to create new sites on WordPress with multisite option enabled?
- How to change the name of the “edit my profile” link in the WordPress admin backend
- WordPress Remove Submenus
- Can a Plugin Override New User Default Role Type
- can i limit editing specific custom fields to certain roles?
- Multisite – maximum number of users with specific role
- Allow only Admin role to access plugin settings/options page
- What are the correct permissions so WP doesn’t ask for FTP credentials if installing plugin?
- How to see which sites use my installed plugins (wordpress multisite)
- WordPress won’t allow for updates to plugins or WordPress Core
- User Capabilities are not available in WP REST permission callback?
- current_user_can(‘administrator’) not working in custom login
- Plugins & backup not working correctly on new Digital Ocean server
- Show WordPress Plugin Menu(Admin) To Editor
- same user role or copy the user role to be same as the other role
- Equivalent of admin.php for public pages
- problem with register_activation_hook in plugin
- Creating teams of users in WordPress
- Ajax request sends url rather than data
- What is the most efficient way of adding additional functionaliy for admin only
- how to create user profile pages and display them based on users roles
- Allow editor user to full permission to access plugin settings
- Plugin updates, change file permissions on WordPress
- Public WP website with one area just for members
- WP Plugin permissions – create new files
- Echo custom admin field into a is_single()
- User / membership Plugin [closed]
- Add_Meta_box to custom page (formidable edit post)
- Overwrite user role
- Add a checkbox in plugin options page and make it actually work
- Embedding code snippets in posts with indentation
- page creator to leave comments ONLY
- Editor have not permissions for a plugin
- Adding hero images to blog posts
- Allow a role to edit one specific plugin
- Frontpage Admin Bar Disappeared
- WordPress Role Capability Restriction
- Allow direct access to files/folders within WordPress to replace wp-admin
- What plugin presents these extra columns in wp-admin -> plugins
- Show only those pages that are created by the specific logged in user in WordPress