John –
Thanks again but that won’t work because it has to get the value from the form:
$value[] = intval(rgar($entry,'16'));
If I just put a clean number into the value it works perfectly:
$value = "1234"
I need to get the related post ID from this (which is returning the Post Object):
rgar($entry,'16')
Hi, John –
Thank you for your support. For some reason this isn’t working. I suspect it’s because I have the relationship field set-up to return the Post Object – not the Post ID. Would this make a difference?
I’ve tried changing it over to return the Post ID but that just creates huge knock effects for the rest of the site – and I don’t want to make my task any more complicated than it is already!
Hi, John –
Thank you for this explanation. Your support is much appreciated. As things stand I have a small snippet which runs in the background as the form is submitted:
add_action('gform_advancedpostcreation_post_after_creation_7', 'gf_calendar_date', 10, 4);
function gf_calendar_date($post_id, $feed, $entry, $form) {
update_post_meta( $post_id, 'calendar_date', $entry['16'] );
}
Should this be changed to this…
add_action('gform_advancedpostcreation_post_after_creation_7', 'gf_calendar_date', 10, 4);
function gf_calendar_date($post_id, $feed, $entry, $form) {
update_post_meta( $post_id, 'calendar_date', $entry['16'] );
update_post_meta( $post_id, '_calendar_date', 'field_63d65a709c89a' );
}
Thanks again.