Skip to content

Instantly share code, notes, and snippets.

@femiyb
Created February 15, 2021 11:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save femiyb/af2d4b0b2cfb1681cecaf77b8fa8237d to your computer and use it in GitHub Desktop.
Save femiyb/af2d4b0b2cfb1681cecaf77b8fa8237d to your computer and use it in GitHub Desktop.
Move Name And Last Name fields
<?php
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Move Email And Confirm Email fields before password
*/
function pmpro_move_name_fields() {
global $pmpro_pages;
if(is_page($pmpro_pages['checkout'])) {
?>
<script>
jQuery( '.pmpro_checkout-field-firstname' ).prependTo( '.pmpro_checkout-field-username' );
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