Hi
I have a form which i want to use to edit a post that a user has created.
I have the follwoing code and I need to pre-populate the example field in the gravity form in this case with "HELO" but obviously will eventually be the variable generated by the query. Im inside the wp-loop BUT i'm quirying a different post ID from the one that the loop is displaying.
The gravity form is embeded from the post-dashboard using the shortcode
This code is not prepolulating the form...? Any thoughts would be really appreciated.
Thanks
<?php $targetPost = $_GET['postID'];
$postTitle = $wpdb->get_var($wpdb->prepare("SELECT post_title FROM $wpdb->posts WHERE ID=$targetPost;"));
echo '<p>Post Title is: ' . $postTitle . '</p>';
add_filter("gform_field_value_form_post_title", "populate_form_post_title");
function populate_form_post_title($value){
return "HELLO";
}
?>