Merged in release/release-1.09 (pull request #10)
Release/release 1.09 * Install missing plugins * rs set to 1 * rebase pantheon for aws * rebase pantheon for aws * prod config change * prod config change * fix campaing issue * revert Approved-by: Jay Sharma
This commit is contained in:
committed by
Jay Sharma
parent
779393381f
commit
22f10a9edd
@@ -28,14 +28,11 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
|
||||
$schema['@context'] = 'https://schema.org';
|
||||
$schema['@type'] = 'Course';
|
||||
|
||||
$schema['name'] = ! empty( $data['name'] ) ? wp_strip_all_tags( (string) $data['name'] ) : null;
|
||||
$schema['name'] = ! empty( $data['name'] ) ? wp_strip_all_tags( (string)$data['name'] ) : NULL;
|
||||
|
||||
$schema['courseCode'] = ! empty( $data['course-code'] ) ? wp_strip_all_tags( (string) $data['course-code'] ) : null;
|
||||
$schema['courseCode'] = ! empty( $data['course-code'] ) ? wp_strip_all_tags( (string)$data['course-code'] ) : NULL;
|
||||
|
||||
$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;;
|
||||
$schema['description'] = ! empty( $data['description'] ) ? wp_strip_all_tags( (string)$data['description'] ) : NULL;
|
||||
|
||||
if ( isset( $data['course-instance'] ) && ! empty( $data['course-instance'] ) ) {
|
||||
|
||||
@@ -47,47 +44,28 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
|
||||
isset( $value['location-address'] ) && ! empty( $value['location-address'] ) ) {
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['@type'] = 'CourseInstance';
|
||||
$schema['hasCourseInstance'][ $key ]['name'] = ! empty( $value['name'] ) ? wp_strip_all_tags( (string) $value['name'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['name'] = ! empty( $value['name'] ) ? wp_strip_all_tags( (string)$value['name'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['description'] = ! empty( $value['description'] ) ? wp_strip_all_tags( (string) $value['description'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['description'] = ! empty( $value['description'] ) ? wp_strip_all_tags( (string)$value['description'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['courseMode'] = ! empty( $value['course-mode'] ) ? wp_strip_all_tags( (string) $value['course-mode'] ) : null;
|
||||
$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 ]['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;
|
||||
$schema['hasCourseInstance'][ $key ]['eventAttendanceMode'] = ! empty( $value['event-attendance-mode'] ) ? wp_strip_all_tags( (string)$value['event-attendance-mode'] ) : 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 ]['startDate'] = wp_strip_all_tags( (string) $start_date );
|
||||
$schema['hasCourseInstance'][ $key ]['startDate'] = wp_strip_all_tags( (string)$start_date );
|
||||
} else {
|
||||
$schema['hasCourseInstance'][ $key ]['startDate'] = wp_strip_all_tags( (string) $value['start-date'] );
|
||||
$schema['hasCourseInstance'][ $key ]['startDate'] = wp_strip_all_tags( (string)$value['start-date'] );
|
||||
}
|
||||
}
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['endDate'] = ! empty( $value['end-date'] ) ? wp_strip_all_tags( (string) $value['end-date'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['endDate'] = ! empty( $value['end-date'] ) ? wp_strip_all_tags( (string)$value['end-date'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['previousStartDate'] = ! empty( $value['previous-date'] ) ? wp_strip_all_tags( (string) $value['previous-date'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['previousStartDate'] = ! empty( $value['previous-date'] ) ? wp_strip_all_tags( (string)$value['previous-date'] ) : NULL;
|
||||
|
||||
if ( isset( $value['online-location'] ) && ! empty( $value['online-location'] ) && 'OfflineEventAttendanceMode' !== $value['event-attendance-mode'] || 'MixedEventAttendanceMode' === $value['event-attendance-mode'] ) {
|
||||
$schema['hasCourseInstance'][ $key ]['location']['@type'] = 'VirtualLocation';
|
||||
@@ -100,34 +78,34 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
|
||||
|
||||
if ( ! empty( $value['location-name'] ) && 'OnlineEventAttendanceMode' !== $value['event-attendance-mode'] ) {
|
||||
$schema['hasCourseInstance'][ $key ]['location']['@type'] = 'Place';
|
||||
$schema['hasCourseInstance'][ $key ]['location']['name'] = wp_strip_all_tags( (string) $value['location-name'] );
|
||||
$schema['hasCourseInstance'][ $key ]['location']['name'] = wp_strip_all_tags( (string)$value['location-name'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $value['location-address'] ) && 'OnlineEventAttendanceMode' !== $value['event-attendance-mode'] && is_string( $value['location-address'] ) ) {
|
||||
$schema['hasCourseInstance'][ $key ]['location']['@type'] = 'Place';
|
||||
$schema['hasCourseInstance'][ $key ]['location']['address'] = wp_strip_all_tags( (string) $value['location-address'] );
|
||||
$schema['hasCourseInstance'][ $key ]['location']['address'] = wp_strip_all_tags( (string)$value['location-address'] );
|
||||
}
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['organizer']['@type'] = 'Organization';
|
||||
$schema['hasCourseInstance'][ $key ]['organizer']['name'] = ! empty( $value['course-organizer-name'] ) ? wp_strip_all_tags( (string) $value['course-organizer-name'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['organizer']['url'] = ! empty( $value['course-organizer-url'] ) ? wp_strip_all_tags( (string) $value['course-organizer-url'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['organizer']['name'] = ! empty( $value['course-organizer-name'] ) ? wp_strip_all_tags( (string)$value['course-organizer-name'] ) : NULL;
|
||||
$schema['hasCourseInstance'][ $key ]['organizer']['url'] = ! empty( $value['course-organizer-url'] ) ? wp_strip_all_tags( (string)$value['course-organizer-url'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['@type'] = 'Offer';
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['price'] = '0';
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['price'] = ! empty( $value['price'] ) ? wp_strip_all_tags( (string) $value['price'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['price'] = ! empty( $value['price'] ) ? wp_strip_all_tags( (string)$value['price'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['priceCurrency'] = ! empty( $value['currency'] ) ? wp_strip_all_tags( (string) $value['currency'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['priceCurrency'] = ! empty( $value['currency'] ) ? wp_strip_all_tags( (string)$value['currency'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['url'] = ! empty( $value['url'] ) ? wp_strip_all_tags( (string) $value['url'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['url'] = ! empty( $value['url'] ) ? wp_strip_all_tags( (string)$value['url'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['validFrom'] = ! empty( $value['valid-from'] ) ? wp_strip_all_tags( (string) $value['valid-from'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['validFrom'] = ! empty( $value['valid-from'] ) ? wp_strip_all_tags( (string)$value['valid-from'] ) : NULL;
|
||||
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['availability'] = ! empty( $value['avail'] ) ? wp_strip_all_tags( (string) $value['avail'] ) : null;
|
||||
$schema['hasCourseInstance'][ $key ]['offers']['availability'] = ! empty( $value['avail'] ) ? wp_strip_all_tags( (string)$value['avail'] ) : NULL;
|
||||
|
||||
if ( ! empty( $value['performer'] ) ) {
|
||||
$schema['hasCourseInstance'][ $key ]['performer']['@type'] = 'Person';
|
||||
$schema['hasCourseInstance'][ $key ]['performer']['name'] = wp_strip_all_tags( (string) $value['performer'] );
|
||||
$schema['hasCourseInstance'][ $key ]['performer']['name'] = wp_strip_all_tags( (string)$value['performer'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +116,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
|
||||
|
||||
$schema['provider']['@type'] = 'Organization';
|
||||
|
||||
$schema['provider']['name'] = ! empty( $data['orgnization-name'] ) ? wp_strip_all_tags( (string) $data['orgnization-name'] ) : null;
|
||||
$schema['provider']['name'] = ! empty( $data['orgnization-name'] ) ? wp_strip_all_tags( (string)$data['orgnization-name'] ) : NULL;
|
||||
if ( isset( $data['same-as'] ) && ! empty( $data['same-as'] ) ) {
|
||||
$schema['provider']['sameAs'] = esc_url( $data['same-as'] );
|
||||
}
|
||||
@@ -149,8 +127,8 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Course' ) ) {
|
||||
|
||||
$schema['aggregateRating']['@type'] = 'AggregateRating';
|
||||
|
||||
$schema['aggregateRating']['ratingValue'] = ! empty( $data['rating'] ) ? wp_strip_all_tags( (string) $data['rating'] ) : null;
|
||||
$schema['aggregateRating']['reviewCount'] = ! empty( $data['review-count'] ) ? wp_strip_all_tags( $data['review-count'] ) : null;
|
||||
$schema['aggregateRating']['ratingValue'] = ! empty( $data['rating'] ) ? wp_strip_all_tags( (string)$data['rating'] ) : NULL;
|
||||
$schema['aggregateRating']['reviewCount'] = ! empty( $data['review-count'] ) ? wp_strip_all_tags( $data['review-count'] ) : NULL;
|
||||
}
|
||||
|
||||
return apply_filters( 'wp_schema_pro_schema_course', $schema, $data, $post );
|
||||
|
||||
Reference in New Issue
Block a user