Created
January 12, 2021 07:20
-
-
Save iamsathyaseelan/02cfc84c971a90de1bc7cf4f966f89fa to your computer and use it in GitHub Desktop.
auto trigger change in email field on page load to solve the issue in capturing loggedin user's details
This file contains hidden or 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 | |
add_filter("wp_footer",function(){ | |
?> | |
<script> | |
document.addEventListener("DOMContentLoaded", function () { | |
let emailField = jQuery("input#billing_email"); | |
if (emailField.length > 0) { | |
emailField.trigger("change"); | |
} | |
}); | |
</script> | |
<?php | |
},100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment