Forked from andrewlimaza/change_text_example.php
Last active
November 20, 2024 12:50
-
-
Save ipokkel/489438493a6cbd84f0a0057f611a8702 to your computer and use it in GitHub Desktop.
gettext change confirmation message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function gettext_change_text_example( $translated_text, $text, $domain ) { | |
if ( 'paid-memberships-pro' === $domain ) { | |
switch ( $text ) { | |
case 'You have selected the %s membership level.': | |
$translated_text = __( 'You have selected the %s membership level. Thank you for your support.', 'paid-memberships-pro' ); | |
break; | |
case 'Text string to replace here': | |
$translated_text = __( 'Your replacement text string here.', 'paid-memberships-pro' ); | |
break; | |
case 'Another text string to replace here': | |
$translated_text = __( 'Your replacement text string here', 'paid-memberships-pro' ); | |
break; | |
} | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'gettext_change_text_example', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment