Skip to content

Instantly share code, notes, and snippets.

@ipokkel
Forked from andrewlimaza/change_text_example.php
Last active December 7, 2023 21:35
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 ipokkel/489438493a6cbd84f0a0057f611a8702 to your computer and use it in GitHub Desktop.
Save ipokkel/489438493a6cbd84f0a0057f611a8702 to your computer and use it in GitHub Desktop.
gettext change confirmation message
<?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_cost_example', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
add_filter( 'gettext', 'change_my_cost_example', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_my_cost_example( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Thank you for your membership to %s. Your %s membership is now active.':
$translated_text = __( 'Merci pour votre adhésion à %1$s. Votre adhésion %2$s est maintenant active.', 'paid-memberships-pro' );
break;
switch ( $translated_text ) {
case 'Thank you for your membership to %1$s. Your %2$s membership status is: <b>%3$s</b>.':
$translated_text = __( 'Merci pour votre adhésion à %1$s. Votre statut de membre %2$s est : <b>%3$s</b>.', 'pmpro-approvals' );
break;
}
return $translated_text;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment