Replies: 0
On /my-account/ page there is a signup option. (only email because I have it set to generate a password)
I want to add this form to a “subscriber type” popup on the home page.
I have created a shortcode which mimics the WooCom form:
add_shortcode('signup_form', 'get_signup_form');
function get_signup_form() {
$wp_nonce_code = wp_nonce_field('signup'.rand(0,1000), '_wpnonce', true, false);
$signup_form_code = <<<EOT
<form method="post" class="popup-register" action="/my-account/">
<p style="text-align:center;"><input type="email" class="popup-input" style="width: 65%;" name="email" id="reg_email" placeholder="Enter your email address"><input type="submit" class="popup-input-submit button" style="margin: 0; border: 1px solid #999999;line-height: 19px;" name="register" value="Register"></p>
<!-- Spam Trap -->
<div style="left: -999em; position: absolute;"><label for="trap">Anti-spam</label><input type="text" name="email_2" id="trap" tabindex="-1"></div>
{$wp_nonce_code}
</form>
EOT;
return $signup_form_code;
}
This works OK BUT it doesn’t create the account – it just loads the /my-account/ page with the email pre-populated… Is there a way to auto-submit this page or is there another page I should POST to?