Created
July 3, 2020 22:09
-
-
Save matheuswd/34a46f0d58d5c06e1cf4d8b88f844ee4 to your computer and use it in GitHub Desktop.
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 | |
function my_give_tribute_by_default() { ?> | |
<script> | |
let searchParams = new URLSearchParams(window.location.search); | |
// Change the parameter name here | |
let referrer = searchParams.has('referrer') ? searchParams.get('referrer') : ''; | |
// Change the target variable here | |
jQuery("input#ffm-referrer").prop("value", referrer); | |
</script> | |
<?php } | |
add_action( 'give_donation_form_after_submit', 'my_give_tribute_by_default' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment