Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryOJob/48fc1a5660265684c26e1dfd60958d8a to your computer and use it in GitHub Desktop.
Save MaryOJob/48fc1a5660265684c26e1dfd60958d8a to your computer and use it in GitHub Desktop.
Reorder the PMPro "Add First and Last Name (add-on)" field setting it to display after the username field
<?php // Do not copy this line
/* Load add name to checkout (pmproan2c) earlier than default
* Can be used to reposition name fields when multiple custom fields are
* loaded after the username field on the checkout page
* Add this code to your PMPro Customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmproan2c_change_priority() {
remove_action( 'pmpro_checkout_after_password', 'pmproan2c_pmpro_checkout_after_password' );
add_action( 'pmpro_checkout_after_username', 'pmproan2c_pmpro_checkout_after_password' );
}
add_action( 'init', 'my_pmproan2c_change_priority' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment