Created
February 24, 2025 06:06
-
-
Save mommaroodles/f22b4de7048621eadb371b891bf65bee to your computer and use it in GitHub Desktop.
Custom Role Labels for WordPress
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
function custom_role_labels( $translated_text, $text, $domain ) { | |
if ( 'woocommerce' === $domain ) { | |
switch ( $text ) { | |
case 'Shop Manager': | |
$translated_text = 'Administrator'; | |
break; | |
case 'Administrator': | |
$translated_text = 'Super Administrator'; | |
break; | |
} | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'custom_role_labels', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment