Merged in feature/102-dev-dev01 (pull request #6)

auto-patch  102-dev-dev01-2023-12-11T19_15_32

* auto-patch  102-dev-dev01-2023-12-11T19_15_32
This commit is contained in:
Tony Volpe
2023-12-11 19:17:10 +00:00
parent 725d3043d5
commit b721d2fd4a
23 changed files with 3956 additions and 3887 deletions

View File

@@ -34,6 +34,9 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
$schema['description'] = ! empty( $data['description'] ) ? wp_strip_all_tags( (string) $data['description'] ) : null;
$schema['offers']['@type'] = 'Offer';
$schema['offers']['category'] = ! empty( $data['offer-category'] ) ? wp_strip_all_tags( (string) $data['offer-category'] ) : null;;
if ( isset( $data['course-instance'] ) && ! empty( $data['course-instance'] ) ) {
foreach ( $data['course-instance'] as $key => $value ) {
@@ -50,6 +53,25 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
$schema['hasCourseInstance'][ $key ]['courseMode'] = ! empty( $value['course-mode'] ) ? wp_strip_all_tags( (string) $value['course-mode'] ) : null;
if ( ! empty( $value['course-workload'] ) ) {
$schema['hasCourseInstance'][ $key ]['courseWorkload'] = ! empty( $value['course-workload'] ) ? wp_strip_all_tags( (string) $value['course-workload'] ) : null;
} else if ( ! empty( $value['repeat-count'] ) && ! empty( $value['repeat-frequency'] ) ) {
$schema['hasCourseInstance'][ $key ]['courseSchedule']['@type'] = 'Schedule';
$schema['hasCourseInstance'][ $key ]['courseSchedule']['repeatCount'] = ! empty( $value['repeat-count'] ) ? wp_strip_all_tags( (string) $value['repeat-count'] ) : null;
$schema['hasCourseInstance'][ $key ]['courseSchedule']['repeatFrequency'] = ! empty( $value['repeat-frequency'] ) ? wp_strip_all_tags( (string) $value['repeat-frequency'] ) : null;
if ( ! empty( $value['start-date'] ) ) {
if ( 'OfflineEventAttendanceMode' !== isset( $value['event-attendance-mode'] ) ) {
$start_date = gmdate( DATE_ISO8601, strtotime( $value['start-date'] ) );
$schema['hasCourseInstance'][ $key ]['courseSchedule']['startDate'] = wp_strip_all_tags( (string) $start_date );
} else {
$schema['hasCourseInstance'][ $key ]['courseSchedule']['startDate'] = wp_strip_all_tags( (string) $value['start-date'] );
}
}
if ( ! empty( $value['end-date'] ) ) {
$schema['hasCourseInstance'][ $key ]['courseSchedule']['endDate'] = ! empty( $value['end-date'] ) ? wp_strip_all_tags( (string) $value['end-date'] ) : null;
}
}
$schema['hasCourseInstance'][ $key ]['eventStatus'] = ! empty( $value['event-status'] ) ? wp_strip_all_tags( (string) $value['event-status'] ) : null;
$schema['hasCourseInstance'][ $key ]['eventAttendanceMode'] = ! empty( $value['event-attendance-mode'] ) ? wp_strip_all_tags( (string) $value['event-attendance-mode'] ) : null;

View File

@@ -28,7 +28,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_FAQ' ) ) {
if ( isset( $data['question-answer'][0]['question'] ) && ! empty( $data['question-answer'][0]['question'] ) ) {
$schema['@context'] = 'https://schema.org';
$schema['type'] = 'FAQPage';
$schema['@type'] = 'FAQPage';
foreach ( $data['question-answer'] as $key => $value ) {
if ( isset( $value['question'] ) && ! empty( $value['question'] ) ) {
$schema['mainEntity'][ $key ]['@type'] = 'Question';