Created
October 19, 2020 10:38
-
-
Save gausam/f1a95df76c2c135113e483d902944bb1 to your computer and use it in GitHub Desktop.
Customise the confirmation text on the confirmation page.
This file contains hidden or 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 customises the confirmation text on the confirmation page. | |
* | |
* 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 my_gettext_confirmation_page( $output_text, $input_text, $domain ) { | |
if ( 'paid-memberships-pro' !== $domain ) { | |
return $output_text; | |
} | |
if ( $output_text === 'Thank you for your membership to %s. Your %s membership is now active.' ) { | |
// replace text in quotes below with your desired text. Remember to always have the two %s placeholders | |
$output_text = "LOREM IPSUM %s. DOLOR %s AMET"; | |
} | |
if ( $output_text === 'Below are details about your membership account and a receipt for your initial membership invoice. A welcome email with a copy of your initial membership invoice has been sent to %s.' ) { | |
// replace text in quotes below with your desired text. Remember to have the %s placeholder | |
$output_text = "SIT AMET %s"; | |
} | |
return $output_text; | |
} | |
add_filter( 'gettext', 'my_gettext_confirmation_page', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment