I tried adding this to my theme functions...but it did not work:
add_filter("gform_field_value_hidden_field", "populate_hidden_field");
function populate_hidden_field(){
return get_post_meta($post->ID, custom_field_key, true);
}
I tried adding this to my theme functions...but it did not work:
add_filter("gform_field_value_hidden_field", "populate_hidden_field");
function populate_hidden_field(){
return get_post_meta($post->ID, custom_field_key, true);
}
Without looking at your site and seeing your form setup and custom field setup, there is no way to tell what is wrong. The Syntax looks correct.
Is my login for your site still active? If so I can take a look and see how things are setup.
yup, you're login still works
I'll need more details on what you are trying to do. Which form is it? Which hidden field? What is the custom field key and which posts already exist containing that custom field key? Be as detailed as possible.
I've logged in but can't determine what you are trying to do or with what field so I need some more details to go on.
I emailed you.
I have corrected the code in your theme, the post variable had to be declared as global. I updated your functions.php file and it's working now. Here is what the revised code looked like:
add_filter("gform_field_value_service_city", "populate_service_city");
function populate_service_city(){
global $post;
$service_city = get_post_meta($post->ID, company_description, true);
return $service_city;
}