Hello,
I would like to populate the_content of spécific post in my form.
add_filter("gform_pre_render", "populate_fields");
add_filter("gform_admin_pre_render", "populate_fields");
function populate_fields($form){
//only populating drop down for form id 12
if($form["id"] != 12)
return $form;
$id_factory = $_GET['id_factory'];
$form["fields"][0]["defaultValue"] = get_post_field( 'post_title', $id_factory, 'display' );
$form["fields"][1]["defaultValue"] = get_post_field( 'post_content', $id_factory, 'display' );
return $form;
}
For the title it's ok, but the_content that's not load...
Any idea ?
Thanks