Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created January 18, 2016 03:27
Show Gist options
  • Save bekarice/e358d558e349a7247bc6 to your computer and use it in GitHub Desktop.
Save bekarice/e358d558e349a7247bc6 to your computer and use it in GitHub Desktop.
Sets the email $_POST value so WC will prefill the "email" field in the My Account registration form
<?php
// get the email param if it's set so the registration form can use it
function sv_get_account_email_param() {
$_POST['email'] = isset( $_GET['email'] ) ? urldecode( $_GET['email'] ) : false;
}
add_action( 'woocommerce_register_form_start', 'sv_get_account_email_param' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment