Created
May 20, 2022 14:46
-
-
Save NickMkrtchyan/bfbb9254a07cc56e211d3132018b5f54 to your computer and use it in GitHub Desktop.
Snippet for rename default WordPress / WooCommerce role name
This file contains hidden or 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
/** | |
* @snippet WooCommerce Rename Customer Role Name | |
* @how-to https://woohacks.github.io/ | |
* @author Nick Mkrtchyan | |
* @compatible WooCommerce 5.0 | |
*/ | |
function change_role_name() { | |
global $wp_roles; | |
if ( ! isset( $wp_roles ) ) | |
$wp_roles = new WP_Roles(); | |
$wp_roles->roles['customer']['name'] = 'Student'; | |
$wp_roles->role_names['customer'] = 'Student'; | |
} | |
add_action('init', 'change_role_name'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment