I want to dynamically populate the category field using the parameter categoryid. In an earlier post by Kevin there was the following code snippet
<?php
add_filter("gform_field_value_categoryid", "populate_categoryid");
function populate_categoryid($value){
return "55" ;
}
?>
where "55" is the explicit value for the parameter categoryid. This works.
But I don't wan't to enter the explicit value by hand but rather use the variable $category_id, which has been calculated earlier in the theme function.
What modification to the above code snippet needs to be done to use the variable $category_id rather than the explicit value "55".