Created
July 15, 2024 13:46
-
-
Save dwanjuki/f46e533ad9b5fdec47adaeed8ea95628 to your computer and use it in GitHub Desktop.
Group Accounts: Change "seat" to "branches" using the gettext filter example
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
<?php | |
/** | |
* Group Accounts: Change "seat" to "branches" using the gettext filter example | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_group_accounts_change_text( $translated, $text, $domain ) { | |
if( $domain == 'pmpro-group-accounts' ) { | |
switch ( $text ) { | |
case 'Seats': | |
$translated = 'Branches'; | |
break; | |
case 'This purchase includes %s additional seat.': | |
$translated = 'This purchase includes %s additional branch.'; | |
break; | |
case 'This purchase includes %s additional seats.': | |
$translated = 'This purchase includes %s additional branches.'; | |
break; | |
} | |
} | |
return $translated; | |
} | |
add_filter( 'gettext', 'my_pmpro_group_accounts_change_text', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Strings in the plugin that include the word Seat: