vendredi 2 janvier 2015

Gravity Forms text box to ACF text field


So I found this post here: Inserting Gravity Form checkbox values into Advanced Custom Fields which is almost exactly what I am looking to do but after a few cracks I am struggling trying to make it work.


My code:



add_action("gform_after_submission_2", "acf_post_submission", 10, 2);

function acf_post_submission ($entry, $form)
{
$post_id = $entry["post_id"];
$values = get_post_custom_values("approved_by_txt", $post_id);
update_field("field_5443acba2beaf", $values, $post_id);
}


Basically I want to map my text field (field Id: 1) in my gravity form to post to my text field in advanced custom fields (field name: approved_by_txt, field key: field_5443acba2beaf).


The above function puts out "Array" in the field which is understandable because its basically pulling all fields data from the form being submitted. Can anyone explain how to make this function target 1 specific field? I was trying to follow example #2: http://ift.tt/1oHkadV which just isn't pulling anything.


Thank you!





Aucun commentaire:

Enregistrer un commentaire