Created
April 1, 2021 14:26
-
-
Save ipokkel/a5da8e8e36102afd5637e5788f8389ee to your computer and use it in GitHub Desktop.
Change or translate text for PMPro Custom Level Cost Text Add On #pmpro-level-cost-text #translate
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 is an example of how to change or translate | |
* localized text strings for PMPro Custom Level Cost Text Add On. | |
* | |
* @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 change_text_for_pmpro_level_cost_text( $translated_text, $text, $domain ) { | |
if ( 'pmpro-level-cost-text' === $domain ) { | |
switch ( $text ) { | |
case 'Free': | |
$translated_text = __( 'Your translation here', 'pmpro-level-cost-text' ); | |
break; | |
} | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'change_text_for_pmpro_level_cost_text', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment