Skip to content

Instantly share code, notes, and snippets.

@michaelbeil
Forked from ipokkel/change-add-paypal-express.php
Last active September 26, 2023 17:23
Show Gist options
  • Save michaelbeil/8e34ef00844c5690287140a32cdd452b to your computer and use it in GitHub Desktop.
Save michaelbeil/8e34ef00844c5690287140a32cdd452b to your computer and use it in GitHub Desktop.
Change text for add paypal express to checkout translation strings
<?php
/**
* This recipe changes text for add paypal express to checkout
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
* @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 'Check Out with a Credit Card Here':
$translated = __( 'Credit Card', 'pmpro-add-paypal-express' );
break;
case 'Check Out with PayPal':
$translated = __( 'PayPal', '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