Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Last active November 7, 2024 06:17
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( ){
global $pmpro_requirebilling;
?>
<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('Checkout and Continue', '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 );
@delta397
Copy link

They say the only dumb questions are the ones that don't get asked. Let me put that to the test.

In checkout.php, one of the parameters is changed from 'pmpro' to 'paid-memberships-pro'. For some reason this is tripping me up mentally -- I am somewhat new to PHP, but I have successfully been modifying the checkout using pmpro custom plugin. I pasted this code in and it works like a charm, but it seems like that difference should be causing an error. Why is it not? Thx.

@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