Is there way to rename user role name without plugin?

function change_role_name() { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); //You can list all currently available roles like this… //$roles = $wp_roles->get_names(); //print_r($roles); //You can replace “administrator” with any other role “editor”, “author”, “contributor” or “subscriber”… $wp_roles->roles[‘administrator’][‘name’] = ‘Owner’; $wp_roles->role_names[‘administrator’] = ‘Owner’; } add_action(‘init’, ‘change_role_name’); http://www.garyc40.com/2010/04/ultimate-guide-to-roles-and-capabilities/

Allow member to have access to custom post type only. Permission to only edit their own posts

Use Justin Tadlock’s plugin “Members“. It gives you the ability to create new roles and edit existing roles, as well as add custom capabilities. All that work that you’d have to do can be taken down to a few clicks. I know you said in your comment on ZaMoose’s answer that you are ‘looking to … Read more

Editor can create any new user except administrator

It’s actually pretty easy. You need to filter into map_meta_caps and stop editors from creating/editing admins, and remove the administrator role from the ‘editable roles’ array. This class, as a plugin or in your theme’s functions.php file would do it: class JPB_User_Caps { // Add our filters function __construct(){ add_filter( ‘editable_roles’, array($this, ‘editable_roles’)); add_filter( ‘map_meta_cap’, … Read more

How to change a user’s role?

See the WP_User class, you can use this to add and remove roles for a user. EDIT: I really should have provided more information with this answer initially, so i’m adding more information below. More specifically, a user’s role can be set by creating an instance of the WP_user class, and calling the add_role() or … Read more

Getting a List of Currently Available Roles on a WordPress Site?

Roles are stored in the global variable $wp_roles. The ideal function is get_editable_roles() from /wp-admin/includes/user.php function get_editable_roles() { global $wp_roles; $all_roles = $wp_roles->roles; $editable_roles = apply_filters(‘editable_roles’, $all_roles); return $editable_roles; } The “editable” part is because it offers other plugins a chance to filter the list in case someone other than admin has ‘edit_users’ privilege (and … Read more

allow editors to edit menus?

add this to your theme’s functions.php: // add editor the privilege to edit theme // get the the role object $role_object = get_role( ‘editor’ ); // add $cap capability to this role object $role_object->add_cap( ‘edit_theme_options’ ); Update (suggested in comments): You probably shouldn’t do this on every request, AFAIK this causes a db write. Better … Read more

How to check if a user is in a specific role?

If you only need this for current user current_user_can() accepts both roles and capabilities. UPDATE: Passing a role name to current_user_can() is no longer guaranteed to work correctly (see #22624). Instead, you may wish to check user role: $user = wp_get_current_user(); if ( in_array( ‘author’, (array) $user->roles ) ) { //The user has the “author” … Read more