Skip to content

Instantly share code, notes, and snippets.

@woodwardtw
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woodwardtw/dece7b45112dcd5c5b6e to your computer and use it in GitHub Desktop.
Save woodwardtw/dece7b45112dcd5c5b6e to your computer and use it in GitHub Desktop.
This is put in the functions.php file of the theme and pulls the content of the post that the form is in to dynamically populate a specific GF field.
//points to the gform field where you've named the variable post_body
add_filter('gform_field_value_post_body', 'populate_post_body');
//fills the post_body variable with the value found in get_the_content
function populate_post_body($value){
global $post;
$post_body = get_the_content();
return $post_body;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment