Skip to content

Instantly share code, notes, and snippets.

@kimwhite
Last active June 8, 2026 15:34
Show Gist options
  • Select an option

  • Save kimwhite/5bdd89e42e15189999ed31f2325a86bd to your computer and use it in GitHub Desktop.

Select an option

Save kimwhite/5bdd89e42e15189999ed31f2325a86bd to your computer and use it in GitHub Desktop.
Group Add On Change seat or seats to something else
<?php // do not copy this line.
/**
* This recipe will change the word Seat to what ever you choose
*
* use with Group Account Add On. https://www.paidmembershipspro.com/add-ons/group-accounts/
*
* 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_gettext( $translation, $text, $domain ) {
if ( 'pmpro-group-accounts' !== $domain ) {
return $translation;
}
$strings = array(
'Number of Seats' => 'Additional Logins',
'Choose the number of seats to purchase. You can purchase between %s and %s seats.' => 'Choose the number of additional logins to purchase. You can purchase between %s and %s additional logins.',
);
if ( isset( $strings[ $text ] ) ) {
return $strings[ $text ];
}
return $translation;
}
add_filter( 'gettext', 'my_pmpro_group_accounts_gettext', 20, 3 );
function my_pmpro_group_accounts_ngettext( $translation, $single, $plural, $number, $domain ) {
if ( 'pmpro-group-accounts' !== $domain ) {
return $translation;
}
if (
'This purchase includes %s additional seat.' === $single &&
'This purchase includes %s additional seats.' === $plural
) {
return 1 === (int) $number
? 'This purchase includes %s additional login.'
: 'This purchase includes %s additional logins.';
}
if (
'You are purchasing %s additional seat.' === $single &&
'You are purchasing %s additional seats.' === $plural
) {
return 1 === (int) $number
? 'You are purchasing %s additional login.'
: 'You are purchasing %s additional logins.';
}
return $translation;
}
add_filter( 'ngettext', 'my_pmpro_group_accounts_ngettext', 20, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment