Hey,
I'm trying to populate a form field with the title of the post to which the form is attached. The post is a custom post type (using sugar events). I can't seem to get it to work.
This is the code i'm using in functions.php:
add_filter('gform_field_value_event_name', 'populate_post_the_title_attribute');
function populate_post_the_title_attribute($value){
global $post;
$the_title_attribute = get_the_title('title', $post->the_title_attribute);
return $the_title_attribute;
}
I also tried using just "the_title" instead of "the_title_attribute", but no luck.
Would really appreciate some help. Thanks for a great plugin!