Created
August 19, 2020 06:29
-
-
Save ipokkel/dcc301e287a74da49cdb654c43b12f76 to your computer and use it in GitHub Desktop.
Change postal code to zip code in PMPro
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 | |
/** | |
* 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