function create_event($post_id, $post, $post_before){
if (get_post_type($post) == 'product') {
$customfield=get_post_meta($post_id, 'custom_field', true);
if ($customfield == 'ja') { //this if query doesn't work
$author = $post->post_author;
$event = array(
'post_type' => 'tribe_events',
'post_title' => get_the_author_meta('firmenname', $author),
'meta_input' => array('post_id' => $post_id, '_EventStartDate' => '2019-06-04 00:00', '_EventEndDate' => '2019-06-04 23:59',
'test'=>$customfield)
);
wp_insert_post($event);
}
}
add action('post_updated', 'create_event', 10, 3);
чтобы получить значение в переменной, вам нужно написать это $customfield=get_post_meta($post_id, 'custom_field', true);