Created
September 8, 2020 14:46
-
-
Save femiyb/df11a90ce0b23c04fe8f59f6db09262e to your computer and use it in GitHub Desktop.
Move Email And Confirm Email fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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_email_fields() { | |
global $pmpro_pages; | |
if(is_page($pmpro_pages['checkout'])) { | |
?> | |
<script> | |
jQuery( '.pmpro_checkout-field-bemail' ).prependTo( '.pmpro_checkout-field-password' ); | |
jQuery( '.pmpro_checkout-field-bconfirmemail' ).appendTo( '.pmpro_checkout-field-bemail' ); | |
</script> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'pmpro_move_email_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated recipe with WPCS spacing applied here: https://gist.github.com/ipokkel/24451963ece680e6f937f2e3fd7dc489