Forked from ipokkel/change-add-paypal-express.php
Last active
March 20, 2025 06:07
-
-
Save kimwhite/c55f1ef21ad3c139af675abc6492316d 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