Skip to content

Instantly share code, notes, and snippets.

@dipakcg
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dipakcg/24db64c9e42972a44ba3 to your computer and use it in GitHub Desktop.
Save dipakcg/24db64c9e42972a44ba3 to your computer and use it in GitHub Desktop.
WordPress - Modify default role names “Administrator, Editor, Author, Contributor, Subscriber” to fit your needs
/*
Change the default role names (Administrator, Editor, Author, Contributor, Subscriber) to any custom names.
Add the following code in theme's functions.php file (edit lines 5 and 6 for custom name).
*/
function wp_change_role_name() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
$wp_roles->roles['contributor']['name'] = 'Owner';
$wp_roles->role_names['contributor'] = 'Owner';
}
add_action('init', 'wp_change_role_name');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment