PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Populate the_content in the WYSIWYG field to GF Add-on

  1. popsantiago
    Member

    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

    Posted 11 years ago on Monday April 8, 2013 | Permalink