0

add_filter( 'wpseo_schema_event', 'update_event_schema_new_fields' );
function update_event_schema_new_fields( $data ) {
 $ev_statuse = get_field('event_status', get_the_ID());
 if($ev_statuse=='postponed'){
  $event_status = 'https://schema.org/EventPostponed';
 }elseif($ev_statuse=='canceled'){
  $event_status = 'https://schema.org/EventCancelled';
 }else{
  $event_status = 'https://schema.org/EventScheduled';
 }
    $data['eventStatus'] = $event_status;
    //var_dump($data);
    $performer = get_field('performer', get_the_ID());
    if(!empty($performer)){
      $data['performer'][] = array(
            '@type' => 'PerformingGroup',
            'name' => $performer,
      );
    }
    return $data;
}

Jagdish Sarma Asked question December 1, 2021
Add a Comment