You probably want to use the gform_field_value_$parameter_name filter to call that Affiliates_Service::get_referrer_id() function from your affiliate plugin
http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name
If you have a hidden field in your form which is set to be populated dynamically (check that box on the advanced tab for your hidden field), and that field has a parameter name of "referrer_id" you will call the filter like this:
[php]
add_filter("gform_field_value_referrer_id", "populate_referrer_id");
Then, you will write a function called populate_referrer_id which will call the Affiliates_Service::get_referrer_id(), maybe like this:
[php]
add_filter('gform_field_value_referrer_id', 'populate_referrer_id');
function populate_referrer_id($value) {
$referrer_id = Affiliates_Service::get_referrer_id();
return $referrer_id;
}
Here is a more verbose example. You are using the same procedure, but your function value comes from the affiliate plugin's function, not built in WordPress functions.
http://www.gravityhelp.com/documentation/page/Dynamically_Populating_the_Post_Author
Let us know if that works out for you.
Posted 12 years ago on Friday August 24, 2012 |
Permalink