Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save femiyb/c8ec4872dcdcbbfcc72eeefa945beb40 to your computer and use it in GitHub Desktop.
Save femiyb/c8ec4872dcdcbbfcc72eeefa945beb40 to your computer and use it in GitHub Desktop.
This Code Gist Will Move the Fields in this order, First Name, Last Name, Email Address and Password When using the Code to Generate a username at PMPro checkout from email for users and hiding the username field with CSS - Links for this below
<?php // Do not Copy This Line
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_move_name_fields() {
global $pmpro_pages;
?>
<script>
jQuery( '.pmpro_checkout-field-bemail' ).prependTo( '.pmpro_checkout-field-password' );
jQuery( '.pmpro_checkout-field-firstname' ).prependTo( '.pmpro_checkout-field-password' );
jQuery( '.pmpro_checkout-field-lastname' ).appendTo( '.pmpro_checkout-field-firstname' );
</script>
<?php
}
add_action( 'wp_footer', 'pmpro_move_name_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment