Articles of user roles

Hide everything on site for visitors except specific page IDs

I have a client who wants to close down access to the entire site, every post, category page, archive etc (while keeping the content), except for three specific pages (Start, about us, contact). None of the membership plugins seem to address this, only logged in roles? I feel like this is the most simple thing […]

Does the “promote_users” capability allow someone to create a new admin account?

I’ve created a “Second Administrator” role to avoid the worst case scenario happening on my WordPress site when I have casual web development contractors. However if I give them the ‘promote_users’ capability, can they promote a random user to an Admin and then circumvent the limitations in place?

How to add local users to wordpress without email password?

I want to organize my posts with random names.Each post will have many authors (those are not actual/real authors).So i do not want to give them any email or password to log in. Actually,i am trying to make project lists and each project has many contributers and each contributer can work on many project.i use […]

How To Remove Dashboard Menu Items for Multisite Users?

I’m trying to remove some menu items in the Dashboard of Multisite users. For example my domain name is xyz.com, his site will be xyz.com/user. When he logs in to WP Dashboard under xyz.com/user/wp-admin, how can I (the admin of xyz.com) remove some options from xyz.com/user (left sidebar) menu? For example, I would like to […]

Using author_can() on custom post types in WordPress

I’m trying to conditionally display some content in a theme using custom roles and capabilities. First, I define a custom role: add_role(‘free_vendor’, ‘Free Vendor Listing’, array(‘read’, ‘edit_posts’, ‘delete_posts’, ‘display_map’)); This is run directly from functions.php (do I need to add it to an action somewhere?) Then I use the display_map capability I defined to conditionally […]

Update User Role Across Network when Main Site User is Updated

I’m using a slightly modified copy of the Multi Site User Management plugin to keeps users synced across a multisite network, but have one problem with it. When a user’s role is updated on the main site, the role is NOT updated on the sub site. In order for everything to work correctly, user roles […]

grant a privilege for roles (for example editors) and higher

My wordpress theme has a custom post-type. Only editors (and higher) should be allowed to use this post type. I did this with: function add_capability($role,$cap) { $role_obj = get_role($role); // get the the role object $role_obj -> add_cap($cap); // add $cap capability to this role object } function set_cpt() { add_capability(‘editor’, ‘edit_cpt’); add_capability(‘editor’, ‘read_cpt’); add_capability(‘editor’, […]

Filter list of rules based on a capability

I’m trying to get a list of roles and filter them by a specific capability (custom). I’ve ran across this post, but I’d like to filter the roles by whether they’re capable to, say, edit_post. -Zack

How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?

The default taxonomy, category. By default, only those with the edit_posts capability can assign categories during post creation/editing. I have a role with very limited capabilities. I want to let users in this role be able to assign categories during custom-post-type creation/editing, but I cannot give them the edit_posts capability and they should not be […]

Downgrade user from role that allows post creation

I am an admin of a multi-author blog. I am implementing a monitoring system which will require me to downgrade a user from an ‘author’ (this role allows them to make a custom post) back to the ‘reader’ role if I think it is a spam account, or if they are breaking website rules. After […]