Last active
September 26, 2023 17:12
-
-
Save ipokkel/5d4e5625fd2e225530e8d91aa911428d to your computer and use it in GitHub Desktop.
Change text for add paypal express to checkout translation strings
This file contains 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/ | |
add_filter( 'gettext', 'change_text_for_add_paypal_express', 20, 3 ); | |
/** | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function change_text_for_add_paypal_express( $translated, $text, $domain ) { | |
switch ( $domain ) { | |
case 'pmpro-add-paypal-express': | |
switch ( $text ) { | |
case 'Choose Your Payment Method': | |
$translated = __( 'Your translation here', 'pmpro-add-paypal-express' ); | |
break; | |
case 'Check Out with a Credit Card Here': | |
$translated = __( 'Your translation here', 'pmpro-add-paypal-express' ); | |
break; | |
case 'Check Out with PayPal': | |
$translated = __( 'Your translation here', 'pmpro-add-paypal-express' ); | |
break; | |
case 'Pay by Check': | |
$translated = __( 'Your translation here', 'pmpro-add-paypal-express' ); | |
break; | |
} | |
break; | |
} | |
return $translated; | |
} | |
add_filter( 'gettext', 'change_text_for_add_paypal_express', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment