Created
July 27, 2017 21:11
-
-
Save SeanTOSCD/64668954012cd5701aaf91a1bf533b8e to your computer and use it in GitHub Desktop.
EDD checkout login form hack
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 | |
/** | |
* Place checkout login form behind a toggle link | |
*/ | |
function eddwp_checkout_login_toggle() { | |
if ( is_user_logged_in() ) { | |
return; | |
} | |
?> | |
<div class="edd-show-login-wrap"> | |
<p id="edd-show-login"> | |
<span class="edd-checkout-login-title">Do you already have an account?</span> | |
<span class="edd-checkout-login-toggle"><a href="#" class="edd-checkout-show-login-form">Click to log in</a></span> | |
</p> | |
</div> | |
<?php | |
} | |
add_action( 'edd_checkout_form_top', 'eddwp_checkout_login_toggle', 1 ); | |
remove_action( 'edd_purchase_form_login_fields', 'edd_get_login_fields' ); | |
add_action( 'edd_checkout_form_top', 'edd_get_login_fields', 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment