Skip to content

Instantly share code, notes, and snippets.

@ipokkel
Last active September 26, 2023 17:12
Show Gist options
  • Save ipokkel/5d4e5625fd2e225530e8d91aa911428d to your computer and use it in GitHub Desktop.
Save ipokkel/5d4e5625fd2e225530e8d91aa911428d to your computer and use it in GitHub Desktop.
Change text for add paypal express to checkout translation strings
<?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