What’s the right way to get the custom fields meta key for the update_post_meta function?
We’ve got four custom fields and this is our working code:
$event_id = tribe_create_event($event_args);
update_post_meta($event_id, '_ecp_custom_1', $event['custom1']);
update_post_meta($event_id, '_ecp_custom_2', $event['custom2']);
update_post_meta($event_id, '_ecp_custom_3', $event['custom3']);
update_post_meta($event_id, '_ecp_custom_4', $event['custom4']);
Now we made a new site, installed the events calendar pro plugin, added the four custom fields again and saw, that the meta keys are different: _ecp_custom_2, _ecp_custom_3, _ecp_custom_4, _ecp_custom_5. _ecp_custom_1 is missing, for whatever reason.
Is there a more portable method?