Last active
August 29, 2015 14:07
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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