Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created December 17, 2025 12:38
Show Gist options
  • Select an option

  • Save andrewlimaza/4c32fe469faa5a58a2a8e664b7cee5c4 to your computer and use it in GitHub Desktop.

Select an option

Save andrewlimaza/4c32fe469faa5a58a2a8e664b7cee5c4 to your computer and use it in GitHub Desktop.
Replace !!pmprorate_downgrade_text!! wording using gettext
<?php
/**
* Change the wording of the Prorations Downgrade Text.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/documentation/templates/customizing-via-a-custom-plugin/
*/
function my_pmpro_change_text( $translated_text, $text, $domain ) {
if ( $domain == 'pmpro-proration' ) {
if ( $text == 'Downgrading to %s on %s.' ) {
$translated_text = 'Changing to %s on %s.'; // Adjust the wording here.
}
if ( $text == 'Downgrading to %s.' ) {
$translated_text = 'Changing to %s.'; // Adjust the wording here.
}
}
return $translated_text;
}
add_filter( 'gettext', 'my_pmpro_change_text', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment