Skip to content

Instantly share code, notes, and snippets.

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 DevinWalker/caecba6d65e90da1fa9d7a7341b14ed6 to your computer and use it in GitHub Desktop.
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.
<?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