Forked from ipokkel/change-advanced-levels-shortcode.php
Last active
January 14, 2022 22:07
-
-
Save michaelbeil/45bdc1a69b40779f305afc8adacbc390 to your computer and use it in GitHub Desktop.
Change or translate text for PMPro Advanced Levels Shortcode using gettext filter #pmpro-advanced-levels-shortcode #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 Advanced Levels Shortcode. | |
* | |
* @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_advanced_levels_shortcode( $translated_text, $text, $domain ) { | |
if ( 'pmpro' === $domain || 'pmpro-advanced-levels-shortcode' === $domain ) { | |
switch ( $text ) { | |
case 'Membership Never Expires.': | |
$translated_text = __( '', 'pmpro-advanced-levels-shortcode' ); | |
break; | |
case 'Membership never expires.': | |
$translated_text = __( '', 'pmpro-advanced-levels-shortcode' ); | |
break; | |
} | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'change_text_for_pmpro_advanced_levels_shortcode', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment