Created
December 2, 2021 17:03
-
-
Save MaryOJob/9f2568b85a6f1d962b298e70f5df87da to your computer and use it in GitHub Desktop.
This code recipe would move the Email address to the top of the checkout page before other 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 // 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; | |
if(is_page($pmpro_pages['checkout'])) { | |
?> | |
<script> | |
jQuery( '.pmpro_checkout-field-bemail' ).prependTo( '.pmpro_checkout-field-username' ); | |
</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