Skip to content

Instantly share code, notes, and snippets.

@femiyb
Created May 21, 2020 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save femiyb/ab74552203340c9ab898af879b96ae16 to your computer and use it in GitHub Desktop.
Save femiyb/ab74552203340c9ab898af879b96ae16 to your computer and use it in GitHub Desktop.
<?php
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_filter( 'gettext', 'change_my_text_example', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_my_text_example( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'The price for membership is <strong>%s</strong> now' :
$translated_text = __( 'The total price is %s today', 'paid-memberships-pro' );
break;
case 'You have selected the <strong>%s</strong> membership level.' :
$translated_text = __( 'You are purchasing the <strong>%s</strong> membership level.', 'paid-memberships-pro' );
break;
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment