Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Last active December 7, 2021 12:52
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 xlplugins/86cc7b286666fe159458fa9ffef16a41 to your computer and use it in GitHub Desktop.
Save xlplugins/86cc7b286666fe159458fa9ffef16a41 to your computer and use it in GitHub Desktop.
Compatability plugin with DIGITS: Merge Phone Number Addon
class WFACP_Do_Not_Fill_username {
public function __construct() {
add_action( 'wfacp_internal_css',[$this,'add_css'] );
}
public function add_css(){
?>
<script>
window.addEventListener('load', function () {
(function ($) {
function pre_filled_value_new() {
$(document.body).on('focusout change', ".wfacp-form-control", function () {
var val= $("#wfacp_checkout_form #username").val();
localStorage.setItem("lastname", val);
});
}
function populate_fields_value_new() {
var test = localStorage.getItem("lastname");
$("#wfacp_checkout_form #username").val(test);
};
setTimeout(function(){
pre_filled_value_new();
populate_fields_value_new();
console.log("tester");
},100);
})(jQuery);
});
</script>
<?php
}
}
new WFACP_Do_Not_Fill_username();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment