Last active
June 20, 2022 18:40
-
-
Save marklchaves/d8b832fb0299f2a496f580a4bf81c6d8 to your computer and use it in GitHub Desktop.
Add document.url as a hidden field
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you need to load your function very late on the page (i.e., after modals or popups), then change line 16 to this.
<?php }, 500 );
Increase 500 all the way up to 900 as needed. The higher the number the lower down in your page your code will load.
This isn't a guarantee since some plugins and themes are greedy and want to be the very last thing loaded (to override everything else).
If that's the case, you might need to wrap the JS in
setTimeout()
to delay the load even longer.