Skip to content

Instantly share code, notes, and snippets.

@dwanjuki
Created November 26, 2025 09:25
Show Gist options
  • Select an option

  • Save dwanjuki/5641f6d071e0340f2a8d2c915c67b21b to your computer and use it in GitHub Desktop.

Select an option

Save dwanjuki/5641f6d071e0340f2a8d2c915c67b21b to your computer and use it in GitHub Desktop.
<?php // copy form below.
/**
* Change the "Select a Payment Plan" heading for a specific level
*
* 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_pmpropp_level_checkout_gettext( $pmpro_level ) {
// Add gettext filter on level 1 checkouts only.
if ( '1' === $pmpro_level->id ) {
add_filter( 'gettext', 'my_pmpropp_change_plans_heading', 10, 3 );
}
}
add_action( 'pmpro_checkout_preheader', 'my_pmpropp_level_checkout_gettext' );
function my_pmpropp_change_plans_heading( $translated_text, $text, $domain ) {
if ( 'pmpro-payment-plans' === $domain ) {
switch ( $text ) {
case 'Select a Payment Plan':
$translated_text = 'Select membership duration';
break;
}
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment