Skip to content

Instantly share code, notes, and snippets.

@ipokkel
Created August 19, 2020 06:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipokkel/dcc301e287a74da49cdb654c43b12f76 to your computer and use it in GitHub Desktop.
Save ipokkel/dcc301e287a74da49cdb654c43b12f76 to your computer and use it in GitHub Desktop.
Change postal code to zip code in PMPro
<?php
/**
* This recipe changes all instances of 'Postal Code' to 'Zip Code' for Paid Memberships Pro.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
* 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 pmpro_change_postal_code_text( $translated_text, $text, $domain ){
switch ( $translated_text ) {
case 'Postal Code' :
$translated_text = __( 'Zip Code', 'paid-memberships-pro' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'pmpro_change_postal_code_text', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment