Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Last active February 26, 2021 09:59
Show Gist options
  • Save JarrydLong/65dfff69cea74b5a0d85a04e421fa2bf to your computer and use it in GitHub Desktop.
Save JarrydLong/65dfff69cea74b5a0d85a04e421fa2bf to your computer and use it in GitHub Desktop.
<?php
/**
* This recipe will adjust shipping related text to something of your preference.
*
* 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/
*/
function mypmpro_adjust_shipping_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Ship to the billing address used above.' :
$translated_text = __( 'Ship to the billing address.', 'pmpro-shipping' );
break;
case 'Check Out with a Credit Card Here':
$translated_text = __( 'Check Out with a Credit Card', 'paid-memberships-pro' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'mypmpro_adjust_shipping_text', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment