Last active
August 29, 2015 14:11
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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