Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Last active July 11, 2023 08:12
Show Gist options
  • Save andrewlimaza/4581a8d5d113cc041bcce20e6dcbb1d6 to your computer and use it in GitHub Desktop.
Save andrewlimaza/4581a8d5d113cc041bcce20e6dcbb1d6 to your computer and use it in GitHub Desktop.
Change default checkout button text for Paid Memberships Pro
<?php
//copy lines 5 - 20 to your active theme's functions.php or custom plugin. (edit line 11 to change text of button).
function my_pmpro_change_default_button_text( ){
//copy over HTML code from checkout.php to keep styling and simply change the text value to 'Create Account'
?>
<span id="pmpro_submit_span">
<input type="hidden" name="submit-checkout" value="1" />
<input type="submit" class="pmpro_btn pmpro_btn-submit-checkout" value="<?php if($pmpro_requirebilling) { _e('Create Account', 'paid-memberships-pro'); } else { _e('Create Account', 'paid-memberships-pro');}?>" />
</span>
<?php
//show default checkout button
return false;
}
add_filter('pmpro_checkout_default_submit_button', 'my_pmpro_change_default_button_text', 10, 2 );
?>
@andrewlimaza
Copy link
Author

Hi @delta397,

This code is fairly old and I have now updated the code - we used to use the text-domain 'pmpro' and to support translation within WordPress.org (GlotPress) we moved over to 'paid-memberships-pro'.

I hope this helps, if you have any questions please open a support thread on www.paidmembershipspro.com

@elias1435
Copy link

Thanks its help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment