Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/f46e533ad9b5fdec47adaeed8ea95628 to your computer and use it in GitHub Desktop.
Save dwanjuki/f46e533ad9b5fdec47adaeed8ea95628 to your computer and use it in GitHub Desktop.
Group Accounts: Change "seat" to "branches" using the gettext filter example
<?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 );
@dwanjuki
Copy link
Author

Strings in the plugin that include the word Seat:

  • Seats
  • This purchase includes %s additional seat.
  • This purchase includes %s additional seats.
  • You are purchasing %s additional seat.
  • You are purchasing %s additional seats.
  • Number of Seats
  • Choose the number of seats to purchase. You can purchase between %s and %s seats.
  • The price per seat is %s.
  • You will be charged an additional %s per seat for with initial payment only.
  • You will be charged an additional %s per seat with each recurring payment.
  • The number of seats must be a whole number.
  • You must purchase at least %s seats.
  • You cannot purchase more than %s seats.
  • There are currently %s members in your group. You must purchase at least that many seats.
  • Users can join your group by using the %1$s code at checkout (%2$s/%3$s seats claimed).
  • Total seats must be a number.
  • Fixed – Set a specific number of allowed seats.
  • Variable – Member can choose number of seats at checkout.
  • Set a specific number of seats in the group or allow the member to choose the number of seats they need at checkout.
  • Total Seats
  • The total number of seats that are included in this group. Note: the group account owner does not count toward this total.
  • Minimum Seats
  • The minimum number of seats that can be added at checkout.
  • Maximum Seats
  • The maximum number of seats that can be added at checkout. Note: the group account owner does not count toward this limit.
  • Per Seat – Set a specific price per additional seat.
  • The pricing model to use for purchasing seats.
  • Cost Per Seat
  • The additional cost at checkout per seat.
  • Define whether the seat cost should be applied for the initial payment, recurring payment, or both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment