Created
April 10, 2016 23:18
-
-
Save strangerstudios/dd8252a9c7a1c95eba3774af30226bab to your computer and use it in GitHub Desktop.
Change some of the text strings in PMPro Addon Packages via the WP gettext filter.
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 | |
function my_gettext_pmproap_changes($translated_text, $text, $domain) | |
{ | |
if($domain == "pmproap" && $text == "Purchase this Content (%s)") | |
$translated_text = "Purchase Now for %s"; | |
elseif($domain == "pmproap" && $text == "Choose a Membership Level") | |
$translated_text = "Choose a Plan"; | |
return $translated_text; | |
} | |
add_filter('gettext', 'my_gettext_pmproap_changes', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Change Frontend Text for Addon Package Purchase Using WP’s gettext Filter" at Paid Memberships Pro here: https://www.paidmembershipspro.com/change-frontend-text-addon-package-purchase-using-wp-gettext-filter/