This is more difficult than it needs to be it seems.
To code it without using a plugin I would suggest using global $menu
and global $submenu
as an array and unset them based on user role or user name. It might get more difficult if you want to define user role permissions outside default values.
http://codex.wordpress.org/Roles_and_Capabilities
You can find the values in wp-admin/menu.php , you must look in here.
Or browse them here http://core.trac.wordpress.org/browser/branches/3.1/wp-admin/menu.php
For example if you want to unset a menu in a function it would be something along the lines of:
function remove_menu() {
global $menu;
//remove post top level menu for editor role
if current_user_can('editor'){
unset($menu[5]); }
}
add_action('admin_head', 'remove_menu');
// ($menu[5]) is the "Posts" menu
You can see a much more detailed example here http://hungred.com/how-to/remove-wordpress-admin-menu-affecting-wordpress-core-system/
Related Posts:
- How to restrict attachment download to a specific user?
- Using JWT to authenticate a user with an external system?
- Allow anonymous user to access Themes Customizer
- Is there an existing capability to allow editing of only pre-existing pages? If not, a good way to implement this?
- How to make user inactive by default while registering?
- How to set privilege to wordpress subscriber for private page
- authenticate user without password from email activation link [duplicate]
- User Access Manager plugin
- How can we Restrict to access a certain wordpress page to all ip address except some which we allow
- Restrict post to user_id
- add_option_page capability behaving strange
- Access denied on Published Pages but not on WordPress /wp-admin/
- Allow non logged users to visit only login page and password reset page
- How can I allow users to make groupings of posts
- Is user listing on wordpress private?
- How to restrict logged user to view only certain pages?
- Limit post display to post authors and create an exception for specific pages
- How to “Global Ignore” / “Hell Ban” someone, restrict post visibility to the author only?
- Conditional menu for registerd users/guests (Genesis framework)
- How can I create an upload page for (and only visible to) specific users?
- remove wp admin menu by customer user role
- Custom Roles for access to specific term(s)
- ‘post’ only for editor and administrator
- Why: sticky front page code, shows latest non-sticky on logged-in front page
- Access denied error when logged in as admin
- Hide all pages except landing page
- How to restrict access to a page?
- How can I change access permissions across many pages?
- How do I get the access type in WordPress?
- Profiles site with access levels
- User access control in sidebar archive and categorires
- Plugins that restrict access based on user group/roles
- Restrict access for wp-admin panel
- Specify the level of access to different pages at the time of user creation
- When add analytics script, wordpress user login not working
- Hide WordPress “wp-admin” dashboard to User IDS
- I cannot access but but wp-admin works normally
- about visibility in wordpress regarding of roles
- Can access main URL and Dashboard but not any posts or pages [closed]
- How to List only the users created by a particular user
- How to enable to the user send content and save as draft entry?
- How to give members access to their own protected page?
- Use WordPress engine for user registration and management
- How to make future posts visible to selected visitors without login
- Add existing user as administrator
- Split post edit screen into sub-edit screens for users, is this good or bad, and is it possible?
- Suggestions for allowing basic users to view their own posts?
- How to restrict posts only from a certain category
- Two users attempt to modify a page
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Hide Admin Menu for Specific User ID who has administrator Role
- Allowing an email as the username?
- Allowing specific users to only add posts using certain custom taxomy terms
- Temporarily disable user role login and replace with message
- Access code/password only restricts page access, no user registration..?
- Restrict access and display for categories
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- How to inhibit dashboard and profile management access to normal users?
- WordPress Multisite prevent direct access to subdomain
- Check if someone is editing a post (this content is currently locked)
- Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php
- front end editing using iFrames, best approach?
- access the plugins for each role in WordPress multisite
- Restrict users post for himself
- Password protect media attachment – share across guests
- Displaying different in-page content to cliente/admin
- User-specific access to folders in WordPress site
- Problem with automatic role change through cron job
- How to create user specific pages (not user role!)?
- Problem with the Loop – want to limit the access to three free articles
- WordPress administrator area access disabled temporarily due to widespread brute force attacks
- Restrict Access in Admin Panel
- User gets access denied to css files and js files even though user is logged in [closed]
- Is there a plugin for WordPress for creating ‘Accounts’ where all users who belong to that Account can only see Account data? [closed]
- Can I “protect” a page with a form asking for an email address?
- Post/Custom Post Type URL Access
- Using my own user table
- Allow Access To Subfolder Of HTML For Logged In Visitors
- Common user login for two different wordpress installation and bbpress
- How to allow only vpn access to dashboard on Bitnami WordPress by IP address restricting
- Infinite redirects at front end if logged in user is not an Admin (Toolset Access)
- How do I allow a user to purchase an expiring passcode to access part of my website, from my online store, similar to pay-per-view?
- How to download file without login to wordpress account?
- Custom user roles are unable to login
- How to show only specific category post by user role without plugin and restrict all other cats
- How to block access to certain WordPress pages using a snippet
- How do you make a custom post type invisible for subscribers
- Users getting linked unwanted to main mu in WordPress multisite (WPMU)
- How to create new permission for custom post types for doing specific tasks
- How can I remove “Add new” button on custom post type
- Restrict Access to the User Profile
- Username has been exposed
- How to Block WordPress from subdomain?
- 3rd Party Login in wordpress
- Allow users to create and store data and retrieve it on login
- Some Subdomains on a Multisite Install Not Found
- WordPress blog fails to open
- How to change user role setting in members plugin so that user can only edit his own post?
- How to give access to programmer/developer to make changes, but prevent undesirable changes? [closed]
- How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount