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.

update custom post field plugin

  1. I would like the data in a form field to be put in a hidden field on the same form when a user hits the submit button. I am using the following code in my functions.php to set a relationship between 2 posts which basically is what I want. How should I use this code when I want two form fields to be the same when the form is submitted?

    do_shortcode("[gravityforms id=2 field_values='ItemID={$post->ID}' ajax=true]");
    add_action("gform_after_submission_2", "update_review_data", 10, 2);
     function update_review_data($entry){
     update_post_meta($entry["post_id"], "_wpcf_belongs_winkel_id", $entry[1]);
     }
    Posted 6 years ago on Monday October 15, 2012 | Permalink
  2. You could use the gform_pre_submission filter to copy the value from one field to another, after the form is submitted.

    http://www.gravityhelp.com/documentation/page/Gform_pre_submission

    Your code would look like this:

    [php]
    add_action('gform_pre_submission', 'copy_field_value');
    function copy_field_value($form) {
        // copy the value which was submitted in
        // field 10 to hidden field 14
        $_POST['input_14'] = rgpost('input_10');
    }

    However, your request does not mention a custom post field, but your title does. Can you let us know if this accomplishes what you need to do?

    Posted 6 years ago on Monday October 15, 2012 | Permalink