Created
November 22, 2019 19:34
-
-
Save DevinWalker/caecba6d65e90da1fa9d7a7341b14ed6 to your computer and use it in GitHub Desktop.
If you'd like to pre-populate a Formidable form on the donation thank you receipt page this is a simple way to pass values to $_GET which it expects.
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 | |
/** | |
* Passing receipt values to $_GET for formidable forms. | |
* | |
* @see: https://formidableforms.com/knowledgebase/using-dynamic-default-values-in-fields/#kb-pass-a-value-to-a-form | |
* | |
* @param $donation | |
* @param $give_receipt_args | |
*/ | |
function givewp_pass_args_to_get($donation, $give_receipt_args) { | |
$_GET['my-param'] = isset($give_receipt_args['donation_receipt']['donation_status']['value']) ? $give_receipt_args['donation_receipt']['donation_status']['value'] : ''; | |
} | |
add_action('give_payment_receipt_before_table', 'givewp_pass_args_to_get', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment