Hi there,
somehow I am struggling to get the value of the form fields with this code below. I just try to dump $entry, but nothing shows. It just returns NULL.
add_action('gform_after_submission_11', 'update_individual_fields_11');
function update_individual_fields_11($entry) {
$form = RGFormsModel::get_form_meta('11');
global $entry;
$post_field = $form[fields][0]["postCustomFieldName"];
echo 'form[fields]';
var_dump ($form[fields]);
//global $form;
echo '</br>';
echo '</br>';
$id = 218; //need to get the current post value there!
echo '$form';
var_dump($form); // form object
echo '</br>';
echo '</br>';
echo '$entry: ';
// ----------------------------------------------------------------
var_dump($entry); // entry object -------is not availabe?????????
// how do I pull the submitted data from form?
// ---------------------------------------------------------
echo '</br>';
echo '</br>';
echo 'Post custom field name: ' . $post_field . '</br>';
// Create entry in post meta
update_post_meta($id, $post_field, 'value from form here', true);
echo '</br>';
echo '</br>';
var_dump($entry);
}
I am sure I am missing something very basic... Just cannot find a way. Any ideas? Thanks!
And (basics again) when do I use just:
global $form and when do I use that:
$form = RGFormsModel::get_form_meta('11');
Is there some documentation on RGFormsModel:: stuff. I am not a coder so struggling with those syntax bits.
In the above example global $form did not seem to work...