Skip to content

Commit

Permalink
fix: Added repeatFrequency, repeatCount and courseMode for LD+JSON
Browse files Browse the repository at this point in the history
fixes #511
  • Loading branch information
itssimple committed Nov 4, 2024
1 parent 594c422 commit e5e5c42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion PLUGIN-CHECKSUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
abf969511e900a6eadfd2d30dac37c94
98e01efe2b2fb78b36679e1d78c8cfc9
18 changes: 10 additions & 8 deletions content/template/data/ld-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
];

if ( $is_ondemand ) {
$_event['courseMode'] = "online";
$_event['location'] = "Online";
$_event['courseMode'] = "Online";
$_event['description'] = 'On-demand';

if ( $event['OnDemandAccessDays'] == null && $selected_course['OnDemandAccessDays'] != null ) {
Expand All @@ -109,14 +108,17 @@
];
}
} else {
$_event['location'] = $event['City'];
$_event['startDate'] = $event['StartDate'];
$_event['endDate'] = $event['EndDate'];
$_event['courseMode'] = "Onsite";
$_event['location'] = $event['City'];
$_event['startDate'] = $event['StartDate'];
$_event['endDate'] = $event['EndDate'];

$_event['courseSchedule'] = [
'@type' => 'Schedule',
'startDate' => $event['StartDate'],
'endDate' => $event['EndDate'],
'@type' => 'Schedule',
'startDate' => $event['StartDate'],
'endDate' => $event['EndDate'],
'repeatFrequency' => 'Daily',
'repeatCount' => count( $event['EventDates'] ),
];
}

Expand Down

0 comments on commit e5e5c42

Please sign in to comment.