Skip to content

Instantly share code, notes, and snippets.

@MaryOJob
Created December 2, 2021 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryOJob/9f2568b85a6f1d962b298e70f5df87da to your computer and use it in GitHub Desktop.
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
<?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