Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
coding...

Angie Jones angiejones

💭
coding...
View GitHub Profile
@marklchaves
marklchaves / avada_forms_hidden_field_set_doc_url.php
Last active Jun 20, 2022
Add document.url as a hidden field
View avada_forms_hidden_field_set_doc_url.php
<?php // Ignore this first line when copying to your child theme's functions.php file.
add_action( 'wp_footer', function () { ?>
<script>
(function() {
if (document.title !== "Test Form – Avada Lab") return; // Run this script on the test form page only.
try {
document.querySelector("#doc-url").setAttribute("value", document.URL);
} catch (e) {