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
@@ -34,50 +34,50 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
switch ( $data['schema-type'] ) {
|
||||
case 'bsf-aiosrs-book':
|
||||
$schema['itemReviewed']['@type'] = 'Book';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-book-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-book-name'] ) : null;
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-book-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-book-name'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-book-author'] ) && ! empty( $data['bsf-aiosrs-book-author'] ) ) {
|
||||
$schema['itemReviewed']['author']['@type'] = 'Person';
|
||||
$schema['itemReviewed']['author']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-book-author'] );
|
||||
$schema['itemReviewed']['author']['sameAs'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-book-same-As'] );
|
||||
$schema['itemReviewed']['author']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-book-author'] );
|
||||
$schema['itemReviewed']['author']['sameAs'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-book-same-As'] );
|
||||
|
||||
}
|
||||
$schema['itemReviewed']['isbn'] = ! empty( $data['bsf-aiosrs-book-serial-number'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-book-serial-number'] ) : null;
|
||||
$schema['description'] = ! empty( $data['bsf-aiosrs-book-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-book-description'] ) : null;
|
||||
$book_url = get_permalink( $post['ID'] );
|
||||
$schema['itemReviewed']['isbn'] = ! empty( $data['bsf-aiosrs-book-serial-number'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-book-serial-number'] ) : NULL;
|
||||
$schema['description'] = ! empty( $data['bsf-aiosrs-book-description'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-book-description'] ) : NULL;
|
||||
$book_url = get_permalink( $post['ID'] );
|
||||
if ( isset( $book_url ) && ! empty( $book_url ) ) {
|
||||
$schema['url'] = esc_url( $book_url );
|
||||
}
|
||||
break;
|
||||
case 'bsf-aiosrs-course':
|
||||
$schema['itemReviewed']['@type'] = 'Course';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-course-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-name'] ) : null;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-course-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-description'] ) : null;
|
||||
$schema['itemReviewed']['@type'] = 'Course';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-course-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-course-name'] ) : NULL;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-course-description'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-course-description'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-course-orgnization-name'] ) && ! empty( $data['bsf-aiosrs-course-orgnization-name'] ) ) {
|
||||
$schema['itemReviewed']['provider']['@type'] = 'Organization';
|
||||
$schema['itemReviewed']['provider']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-course-orgnization-name'] );
|
||||
$schema['itemReviewed']['provider']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-course-orgnization-name'] );
|
||||
}
|
||||
break;
|
||||
case 'bsf-aiosrs-event':
|
||||
$schema['itemReviewed']['@type'] = 'event';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-event-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-name'] ) : null;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-event-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-description'] ) : null;
|
||||
$schema['itemReviewed']['@type'] = 'event';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-event-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-name'] ) : NULL;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-event-description'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-description'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-event-image'] ) && ! empty( $data['bsf-aiosrs-event-image'] ) ) {
|
||||
$schema['itemReviewed']['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['bsf-aiosrs-event-image'] );
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-event-start-date'] ) && ! empty( $data['bsf-aiosrs-event-start-date'] ) ) {
|
||||
if ( 'OfflineEventAttendanceMode' !== $data['bsf-aiosrs-event-event-attendance-mode'] ) {
|
||||
$start_date = gmdate( DATE_ISO8601, strtotime( $data['bsf-aiosrs-event-start-date'] ) );
|
||||
$schema['itemReviewed']['startDate'] = wp_strip_all_tags( (string) $start_date );
|
||||
$schema['itemReviewed']['startDate'] = wp_strip_all_tags( (string)$start_date );
|
||||
} else {
|
||||
$schema['itemReviewed']['startDate'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-event-start-date'] );
|
||||
$schema['itemReviewed']['startDate'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-event-start-date'] );
|
||||
}
|
||||
}
|
||||
$schema['itemReviewed']['endDate'] = ! empty( $data['bsf-aiosrs-event-end-date'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-end-date'] ) : null;
|
||||
$schema['itemReviewed']['eventStatus'] = ! empty( $data['bsf-aiosrs-event-event-status'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-event-status'] ) : null;
|
||||
$schema['itemReviewed']['endDate'] = ! empty( $data['bsf-aiosrs-event-end-date'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-end-date'] ) : NULL;
|
||||
$schema['itemReviewed']['eventStatus'] = ! empty( $data['bsf-aiosrs-event-event-status'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-event-status'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['eventAttendanceMode'] = ! empty( $data['bsf-aiosrs-event-event-attendance-mode'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-event-attendance-mode'] ) : null;
|
||||
$schema['itemReviewed']['eventAttendanceMode'] = ! empty( $data['bsf-aiosrs-event-event-attendance-mode'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-event-attendance-mode'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['previousStartDate'] = ! empty( $data['bsf-aiosrs-event-previous-date'] ) && 'EventRescheduled' === $data['bsf-aiosrs-event-event-status'] ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-previous-date'] ) : null;
|
||||
$schema['itemReviewed']['previousStartDate'] = ! empty( $data['bsf-aiosrs-event-previous-date'] ) && 'EventRescheduled' === $data['bsf-aiosrs-event-event-status'] ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-previous-date'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-event-online-location'] ) && ! empty( $data['bsf-aiosrs-event-online-location'] ) &&
|
||||
( 'OfflineEventAttendanceMode' !== $data['bsf-aiosrs-event-event-attendance-mode'] ) ||
|
||||
( 'MixedEventAttendanceMode' === $data['bsf-aiosrs-event-event-attendance-mode'] ) ) {
|
||||
@@ -86,11 +86,11 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-event-performer'] ) && ! empty( $data['bsf-aiosrs-event-performer'] ) ) {
|
||||
$schema['itemReviewed']['performer']['@type'] = 'Person';
|
||||
$schema['itemReviewed']['performer']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-event-performer'] );
|
||||
$schema['itemReviewed']['performer']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-event-performer'] );
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-event-location'] ) && ! empty( $data['bsf-aiosrs-event-location'] ) && 'OnlineEventAttendanceMode' !== $data['bsf-aiosrs-event-event-attendance-mode'] ) {
|
||||
$schema['itemReviewed']['location']['@type'] = 'Place';
|
||||
$schema['itemReviewed']['location']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-event-location'] );
|
||||
$schema['itemReviewed']['location']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-event-location'] );
|
||||
}
|
||||
if ( ( ( isset( $data['bsf-aiosrs-event-location-street'] ) && ! empty( $data['bsf-aiosrs-event-location-street'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-event-location-locality'] ) && ! empty( $data['bsf-aiosrs-event-location-locality'] ) ) ||
|
||||
@@ -99,11 +99,11 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
( isset( $data['bsf-aiosrs-event-location-country'] ) && ! empty( $data['bsf-aiosrs-event-location-country'] ) ) ) && ( 'OnlineEventAttendanceMode' !== $data['bsf-aiosrs-event-event-attendance-mode'] ) ) {
|
||||
$schema['itemReviewed']['location']['address']['@type'] = 'PostalAddress';
|
||||
|
||||
$schema['itemReviewed']['location']['address']['streetAddress'] = ! empty( $data['bsf-aiosrs-event-location-street'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-location-street'] ) : null;
|
||||
$schema['itemReviewed']['location']['address']['addressLocality'] = ! empty( $data['bsf-aiosrs-event-location-locality'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-location-locality'] ) : null;
|
||||
$schema['itemReviewed']['location']['address']['postalCode'] = ! empty( $data['bsf-aiosrs-event-location-postal'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-location-postal'] ) : null;
|
||||
$schema['itemReviewed']['location']['address']['addressRegion'] = ! empty( $data['bsf-aiosrs-event-location-region'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-location-region'] ) : null;
|
||||
$schema['itemReviewed']['location']['address']['addressCountry'] = ! empty( $data['bsf-aiosrs-event-location-country'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-location-country'] ) : null;
|
||||
$schema['itemReviewed']['location']['address']['streetAddress'] = ! empty( $data['bsf-aiosrs-event-location-street'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-location-street'] ) : NULL;
|
||||
$schema['itemReviewed']['location']['address']['addressLocality'] = ! empty( $data['bsf-aiosrs-event-location-locality'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-location-locality'] ) : NULL;
|
||||
$schema['itemReviewed']['location']['address']['postalCode'] = ! empty( $data['bsf-aiosrs-event-location-postal'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-location-postal'] ) : NULL;
|
||||
$schema['itemReviewed']['location']['address']['addressRegion'] = ! empty( $data['bsf-aiosrs-event-location-region'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-location-region'] ) : NULL;
|
||||
$schema['itemReviewed']['location']['address']['addressCountry'] = ! empty( $data['bsf-aiosrs-event-location-country'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-location-country'] ) : NULL;
|
||||
}
|
||||
$schema['itemReviewed']['offers']['@type'] = 'Offer';
|
||||
|
||||
@@ -114,17 +114,17 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
if ( isset( $data['bsf-aiosrs-event-ticket-buy-url'] ) && ! empty( $data['bsf-aiosrs-event-ticket-buy-url'] ) ) {
|
||||
$schema['itemReviewed']['offers']['url'] = esc_url( $data['bsf-aiosrs-event-ticket-buy-url'] );
|
||||
}
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-event-price'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-price'] ) : null;
|
||||
$schema['itemReviewed']['offers']['availability'] = ! empty( $data['bsf-aiosrs-event-avail'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-avail'] ) : null;
|
||||
$schema['itemReviewed']['offers']['priceCurrency'] = ! empty( $data['bsf-aiosrs-event-currency'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-currency'] ) : null;
|
||||
$schema['itemReviewed']['offers']['validFrom'] = ! empty( $data['bsf-aiosrs-event-valid-from'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-valid-from'] ) : null;
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-event-price'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-price'] ) : NULL;
|
||||
$schema['itemReviewed']['offers']['availability'] = ! empty( $data['bsf-aiosrs-event-avail'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-avail'] ) : NULL;
|
||||
$schema['itemReviewed']['offers']['priceCurrency'] = ! empty( $data['bsf-aiosrs-event-currency'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-currency'] ) : NULL;
|
||||
$schema['itemReviewed']['offers']['validFrom'] = ! empty( $data['bsf-aiosrs-event-valid-from'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-valid-from'] ) : NULL;
|
||||
}
|
||||
if ( ( isset( $data['bsf-aiosrs-event-event-organizer-name'] ) && ! empty( $data['bsf-aiosrs-event-event-organizer-name'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-event-event-organizer-url'] ) && ! empty( $data['bsf-aiosrs-event-event-organizer-url'] ) ) ) {
|
||||
|
||||
$schema['itemReviewed']['organizer']['@type'] = 'Organization';
|
||||
|
||||
$schema['itemReviewed']['organizer']['name'] = ! empty( $data['bsf-aiosrs-event-event-organizer-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-event-organizer-name'] ) : null;
|
||||
$schema['itemReviewed']['organizer']['name'] = ! empty( $data['bsf-aiosrs-event-event-organizer-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-event-event-organizer-name'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-event-event-organizer-url'] ) && ! empty( $data['bsf-aiosrs-event-event-organizer-url'] ) ) {
|
||||
$schema['itemReviewed']['organizer']['url'] = esc_url( $data['bsf-aiosrs-event-event-organizer-url'] );
|
||||
}
|
||||
@@ -132,12 +132,12 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
break;
|
||||
case 'bsf-aiosrs-local-business':
|
||||
$schema['itemReviewed']['@type'] = 'LocalBusiness';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-local-business-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-name'] ) : null;
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-local-business-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-name'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-local-business-image'] ) && ! empty( $data['bsf-aiosrs-local-business-image'] ) ) {
|
||||
|
||||
$schema['itemReviewed']['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['bsf-aiosrs-local-business-image'] );
|
||||
}
|
||||
$schema['itemReviewed']['telephone'] = ! empty( $data['bsf-aiosrs-local-business-telephone'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-telephone'] ) : null;
|
||||
$schema['itemReviewed']['telephone'] = ! empty( $data['bsf-aiosrs-local-business-telephone'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-telephone'] ) : NULL;
|
||||
if ( ( isset( $data['bsf-aiosrs-local-business-location-street'] ) && ! empty( $data['bsf-aiosrs-local-business-location-street'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-local-business-location-locality'] ) && ! empty( $data['bsf-aiosrs-local-business-location-locality'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-local-business-location-postal'] ) && ! empty( $data['bsf-aiosrs-local-business-location-postal'] ) ) ||
|
||||
@@ -146,44 +146,44 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
|
||||
$schema['itemReviewed']['address']['@type'] = 'PostalAddress';
|
||||
|
||||
$schema['itemReviewed']['address']['streetAddress'] = ! empty( $data['bsf-aiosrs-local-business-location-street'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-location-street'] ) : null;
|
||||
$schema['itemReviewed']['address']['addressLocality'] = ! empty( $data['bsf-aiosrs-local-business-location-locality'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-location-locality'] ) : null;
|
||||
$schema['itemReviewed']['address']['postalCode'] = ! empty( $data['bsf-aiosrs-local-business-location-postal'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-location-postal'] ) : null;
|
||||
$schema['itemReviewed']['address']['addressRegion'] = ! empty( $data['bsf-aiosrs-local-business-location-region'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-location-region'] ) : null;
|
||||
$schema['itemReviewed']['address']['addressCountry'] = ! empty( $data['bsf-aiosrs-local-business-location-country'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-location-country'] ) : null;
|
||||
$schema['itemReviewed']['address']['streetAddress'] = ! empty( $data['bsf-aiosrs-local-business-location-street'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-location-street'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['addressLocality'] = ! empty( $data['bsf-aiosrs-local-business-location-locality'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-location-locality'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['postalCode'] = ! empty( $data['bsf-aiosrs-local-business-location-postal'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-location-postal'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['addressRegion'] = ! empty( $data['bsf-aiosrs-local-business-location-region'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-location-region'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['addressCountry'] = ! empty( $data['bsf-aiosrs-local-business-location-country'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-location-country'] ) : NULL;
|
||||
}
|
||||
$schema['itemReviewed']['priceRange'] = ! empty( $data['bsf-aiosrs-local-business-price-range'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-local-business-price-range'] ) : null;
|
||||
$schema['itemReviewed']['priceRange'] = ! empty( $data['bsf-aiosrs-local-business-price-range'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-local-business-price-range'] ) : NULL;
|
||||
break;
|
||||
case 'bsf-aiosrs-recipe':
|
||||
$schema['itemReviewed']['@type'] = 'Recipe';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-recipe-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-name'] ) : null;
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-recipe-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-name'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-recipe-image'] ) && ! empty( $data['bsf-aiosrs-recipe-image'] ) ) {
|
||||
$schema['itemReviewed']['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['bsf-aiosrs-recipe-image'] );
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-recipe-author'] ) && ! empty( $data['bsf-aiosrs-recipe-author'] ) ) {
|
||||
$schema['itemReviewed']['author']['@type'] = 'Person';
|
||||
$schema['itemReviewed']['author']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-author'] );
|
||||
$schema['itemReviewed']['author']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-author'] );
|
||||
}
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-recipe-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-description'] ) : null;
|
||||
$schema['itemReviewed']['prepTime'] = ! empty( $data['bsf-aiosrs-recipe-preperation-time'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-preperation-time'] ) : null;
|
||||
$schema['itemReviewed']['cookTime'] = ! empty( $data['bsf-aiosrs-recipe-cook-time'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-cook-time'] ) : null;
|
||||
$schema['itemReviewed']['keywords'] = ! empty( $data['bsf-aiosrs-recipe-recipe-keywords'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-keywords'] ) : null;
|
||||
$schema['itemReviewed']['recipeCategory'] = ! empty( $data['bsf-aiosrs-recipe-recipe-category'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-category'] ) : null;
|
||||
$schema['itemReviewed']['recipeCuisine'] = ! empty( $data['bsf-aiosrs-recipe-recipe-cuisine'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-cuisine'] ) : null;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-recipe-description'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-description'] ) : NULL;
|
||||
$schema['itemReviewed']['prepTime'] = ! empty( $data['bsf-aiosrs-recipe-preperation-time'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-preperation-time'] ) : NULL;
|
||||
$schema['itemReviewed']['cookTime'] = ! empty( $data['bsf-aiosrs-recipe-cook-time'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-cook-time'] ) : NULL;
|
||||
$schema['itemReviewed']['keywords'] = ! empty( $data['bsf-aiosrs-recipe-recipe-keywords'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-keywords'] ) : NULL;
|
||||
$schema['itemReviewed']['recipeCategory'] = ! empty( $data['bsf-aiosrs-recipe-recipe-category'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-category'] ) : NULL;
|
||||
$schema['itemReviewed']['recipeCuisine'] = ! empty( $data['bsf-aiosrs-recipe-recipe-cuisine'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-cuisine'] ) : NULL;
|
||||
if ( ( isset( $data['bsf-aiosrs-recipe-rating'] ) && ! empty( $data['bsf-aiosrs-recipe-rating'] ) ) ||
|
||||
( isset( $data['review-count'] ) && ! empty( $data['review-count'] ) ) ) {
|
||||
$schema['itemReviewed']['aggregateRating']['@type'] = 'AggregateRating';
|
||||
$schema['itemReviewed']['aggregateRating']['ratingValue'] = ! empty( $data['bsf-aiosrs-recipe-rating'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-rating'] ) : null;
|
||||
$schema['itemReviewed']['aggregateRating']['reviewCount'] = ! empty( $data['bsf-aiosrs-recipe-review-count'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-review-count'] ) : null;
|
||||
$schema['itemReviewed']['aggregateRating']['@type'] = 'AggregateRating';
|
||||
$schema['itemReviewed']['aggregateRating']['ratingValue'] = ! empty( $data['bsf-aiosrs-recipe-rating'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-rating'] ) : NULL;
|
||||
$schema['itemReviewed']['aggregateRating']['reviewCount'] = ! empty( $data['bsf-aiosrs-recipe-review-count'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-review-count'] ) : NULL;
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-recipe-nutrition'] ) && ! empty( $data['bsf-aiosrs-recipe-nutrition'] ) ) {
|
||||
$schema['itemReviewed']['nutrition']['@type'] = 'NutritionInformation';
|
||||
$schema['itemReviewed']['nutrition']['calories'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-nutrition'] );
|
||||
$schema['itemReviewed']['nutrition']['calories'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-nutrition'] );
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-recipe-ingredients'] ) && ! empty( $data['bsf-aiosrs-recipe-ingredients'] ) ) {
|
||||
$recipe_ingredients = explode( ',', $data['bsf-aiosrs-recipe-ingredients'] );
|
||||
foreach ( $recipe_ingredients as $key => $value ) {
|
||||
$schema['itemReviewed']['recipeIngredient'][ $key ] = wp_strip_all_tags( (string) $value );
|
||||
$schema['itemReviewed']['recipeIngredient'][ $key ] = wp_strip_all_tags( (string)$value );
|
||||
}
|
||||
}
|
||||
if ( isset( $data['bsf-aiosrs-recipe-recipe-instructions'] ) && ! empty( $data['bsf-aiosrs-recipe-recipe-instructions'] ) ) {
|
||||
@@ -191,15 +191,15 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
foreach ( $recipe_instructions as $key => $value ) {
|
||||
if ( isset( $value ) && ! empty( $value ) ) {
|
||||
$schema['itemReviewed']['recipeInstructions'][ $key ]['@type'] = 'HowToStep';
|
||||
$schema['itemReviewed']['recipeInstructions'][ $key ]['text'] = wp_strip_all_tags( (string) $value );
|
||||
$schema['itemReviewed']['recipeInstructions'][ $key ]['text'] = wp_strip_all_tags( (string)$value );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $data['bsf-aiosrs-recipe-video-name'] ) && ! empty( $data['bsf-aiosrs-recipe-video-name'] ) ) {
|
||||
$schema['itemReviewed']['video']['@type'] = 'VideoObject';
|
||||
$schema['itemReviewed']['video']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-video-name'] );
|
||||
$schema['itemReviewed']['video']['description'] = ! empty( $data['bsf-aiosrs-recipe-video-desc'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-video-desc'] ) : null;
|
||||
$schema['itemReviewed']['video']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-video-name'] );
|
||||
$schema['itemReviewed']['video']['description'] = ! empty( $data['bsf-aiosrs-recipe-video-desc'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-video-desc'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-recipe-video-image'] ) && ! empty( $data['bsf-aiosrs-recipe-video-image'] ) ) {
|
||||
$schema['itemReviewed']['video']['thumbnailUrl'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['bsf-aiosrs-recipe-video-image'] );
|
||||
}
|
||||
@@ -209,51 +209,51 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
if ( isset( $data['bsf-aiosrs-recipe-recipe-video-embed-url'] ) && ! empty( $data['bsf-aiosrs-recipe-recipe-video-embed-url'] ) ) {
|
||||
$schema['itemReviewed']['video']['embedUrl'] = esc_url( $data['bsf-aiosrs-recipe-recipe-video-embed-url'] );
|
||||
}
|
||||
$schema['itemReviewed']['video']['duration'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-duration'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-video-duration'] ) : null;
|
||||
$schema['itemReviewed']['video']['uploadDate'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-upload-date'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-video-upload-date'] ) : null;
|
||||
$schema['itemReviewed']['video']['interactionCount'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-interaction-count'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-video-interaction-count'] ) : null;
|
||||
$schema['itemReviewed']['video']['expires'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-expires-date'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-recipe-recipe-video-expires-date'] ) : null;
|
||||
$schema['itemReviewed']['video']['duration'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-duration'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-video-duration'] ) : NULL;
|
||||
$schema['itemReviewed']['video']['uploadDate'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-upload-date'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-video-upload-date'] ) : NULL;
|
||||
$schema['itemReviewed']['video']['interactionCount'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-interaction-count'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-video-interaction-count'] ) : NULL;
|
||||
$schema['itemReviewed']['video']['expires'] = ! empty( $data['bsf-aiosrs-recipe-recipe-video-expires-date'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-recipe-recipe-video-expires-date'] ) : NULL;
|
||||
}
|
||||
break;
|
||||
case 'bsf-aiosrs-software-application':
|
||||
$schema['itemReviewed']['@type'] = 'SoftwareApplication';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-software-application-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-name'] ) : null;
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-software-application-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-name'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['operatingSystem'] = ! empty( $data['bsf-aiosrs-software-application-operating-system'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-operating-system'] ) : null;
|
||||
$schema['itemReviewed']['operatingSystem'] = ! empty( $data['bsf-aiosrs-software-application-operating-system'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-operating-system'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['applicationCategory'] = ! empty( $data['bsf-aiosrs-software-application-category'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-category'] ) : null;
|
||||
$schema['itemReviewed']['applicationCategory'] = ! empty( $data['bsf-aiosrs-software-application-category'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-category'] ) : NULL;
|
||||
|
||||
if ( ( isset( $data['bsf-aiosrs-software-application-rating'] ) && ! empty( $data['bsf-aiosrs-software-application-rating'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-software-application-review-count'] ) && ! empty( $data['bsf-aiosrs-software-application-review-count'] ) ) ) {
|
||||
|
||||
$schema['itemReviewed']['aggregateRating']['@type'] = 'AggregateRating';
|
||||
|
||||
$schema['itemReviewed']['aggregateRating']['ratingValue'] = ! empty( $data['bsf-aiosrs-software-application-rating'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-rating'] ) : null;
|
||||
$schema['itemReviewed']['aggregateRating']['reviewCount'] = ! empty( $data['bsf-aiosrs-software-application-review-count'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-review-count'] ) : null;
|
||||
$schema['itemReviewed']['aggregateRating']['ratingValue'] = ! empty( $data['bsf-aiosrs-software-application-rating'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-rating'] ) : NULL;
|
||||
$schema['itemReviewed']['aggregateRating']['reviewCount'] = ! empty( $data['bsf-aiosrs-software-application-review-count'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-review-count'] ) : NULL;
|
||||
}
|
||||
if ( true === apply_filters( 'wp_schema_pro_remove_software_application_offers_review_type', true ) ) {
|
||||
$schema['itemReviewed']['offers']['@type'] = 'Offer';
|
||||
$schema['itemReviewed']['offers']['price'] = '0';
|
||||
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-software-application-price'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-price'] ) : null;
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-software-application-price'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-price'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['offers']['priceCurrency'] = ! empty( $data['bsf-aiosrs-software-application-currency'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-software-application-currency'] ) : null;
|
||||
$schema['itemReviewed']['offers']['priceCurrency'] = ! empty( $data['bsf-aiosrs-software-application-currency'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-software-application-currency'] ) : NULL;
|
||||
}
|
||||
break;
|
||||
case 'bsf-aiosrs-product':
|
||||
$schema['itemReviewed']['@type'] = 'product';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-product-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-name'] ) : null;
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-product-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-name'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-product-image'] ) && ! empty( $data['bsf-aiosrs-product-image'] ) ) {
|
||||
$schema['itemReviewed']['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['bsf-aiosrs-product-image'] );
|
||||
}
|
||||
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-product-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-description'] ) : null;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-product-description'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-description'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['sku'] = ! empty( $data['bsf-aiosrs-product-sku'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-sku'] ) : null;
|
||||
$schema['itemReviewed']['mpn'] = ! empty( $data['bsf-aiosrs-product-mpn'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-mpn'] ) : null;
|
||||
$schema['itemReviewed']['sku'] = ! empty( $data['bsf-aiosrs-product-sku'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-sku'] ) : NULL;
|
||||
$schema['itemReviewed']['mpn'] = ! empty( $data['bsf-aiosrs-product-mpn'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-mpn'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-product-brand-name'] ) && ! empty( $data['bsf-aiosrs-product-brand-name'] ) ) {
|
||||
$schema['itemReviewed']['brand']['@type'] = 'Organization';
|
||||
$schema['itemReviewed']['brand']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-product-brand-name'] );
|
||||
$schema['itemReviewed']['brand']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-product-brand-name'] );
|
||||
}
|
||||
|
||||
if ( ( isset( $data['bsf-aiosrs-product-rating'] ) && ! empty( $data['bsf-aiosrs-product-rating'] ) ) ||
|
||||
@@ -261,44 +261,44 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
|
||||
$schema['itemReviewed']['aggregateRating']['@type'] = 'AggregateRating';
|
||||
|
||||
$schema['itemReviewed']['aggregateRating']['ratingValue'] = ! empty( $data['bsf-aiosrs-product-rating'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-rating'] ) : null;
|
||||
$schema['itemReviewed']['aggregateRating']['reviewCount'] = ! empty( $data['bsf-aiosrs-product-review-count'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-review-count'] ) : null;
|
||||
$schema['itemReviewed']['aggregateRating']['ratingValue'] = ! empty( $data['bsf-aiosrs-product-rating'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-rating'] ) : NULL;
|
||||
$schema['itemReviewed']['aggregateRating']['reviewCount'] = ! empty( $data['bsf-aiosrs-product-review-count'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-review-count'] ) : NULL;
|
||||
}
|
||||
if ( apply_filters( 'wp_schema_pro_remove_product_offers', true ) ) {
|
||||
$schema['itemReviewed']['offers']['@type'] = 'Offer';
|
||||
$schema['itemReviewed']['offers']['price'] = '0';
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-product-price'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-price'] ) : null;
|
||||
$schema['itemReviewed']['offers']['priceValidUntil'] = ! empty( $data['bsf-aiosrs-product-price-valid-until'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-price-valid-until'] ) : null;
|
||||
$schema['itemReviewed']['offers']['@type'] = 'Offer';
|
||||
$schema['itemReviewed']['offers']['price'] = '0';
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-product-price'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-price'] ) : NULL;
|
||||
$schema['itemReviewed']['offers']['priceValidUntil'] = ! empty( $data['bsf-aiosrs-product-price-valid-until'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-price-valid-until'] ) : NULL;
|
||||
|
||||
$schema['itemReviewed']['offers']['url'] = get_permalink( $post['ID'] );
|
||||
|
||||
if ( ( isset( $data['bsf-aiosrs-product-currency'] ) && ! empty( $data['bsf-aiosrs-product-currency'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-product-avail'] ) && ! empty( $data['bsf-aiosrs-product-avail'] ) ) ) {
|
||||
|
||||
$schema['itemReviewed']['offers']['priceCurrency'] = ! empty( $data['bsf-aiosrs-product-currency'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-currency'] ) : null;
|
||||
$schema['itemReviewed']['offers']['availability'] = ! empty( $data['bsf-aiosrs-product-avail'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-product-avail'] ) : null;
|
||||
$schema['itemReviewed']['offers']['priceCurrency'] = ! empty( $data['bsf-aiosrs-product-currency'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-currency'] ) : NULL;
|
||||
$schema['itemReviewed']['offers']['availability'] = ! empty( $data['bsf-aiosrs-product-avail'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-product-avail'] ) : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 'bsf-aiosrs-movie':
|
||||
$schema['itemReviewed']['@type'] = 'Movie';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-movie-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-movie-name'] ) : null;
|
||||
$schema['itemReviewed']['sameAs'] = ! empty( $data['bsf-aiosrs-movie-same-As'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-movie-same-As'] ) : null;
|
||||
$schema['itemReviewed']['@type'] = 'Movie';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-movie-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-movie-name'] ) : NULL;
|
||||
$schema['itemReviewed']['sameAs'] = ! empty( $data['bsf-aiosrs-movie-same-As'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-movie-same-As'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-movie-image'] ) && ! empty( $data['bsf-aiosrs-movie-image'] ) ) {
|
||||
$schema['itemReviewed']['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['bsf-aiosrs-movie-image'] );
|
||||
}
|
||||
$schema['itemReviewed']['dateCreated'] = ! empty( $data['bsf-aiosrs-movie-dateCreated'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-movie-dateCreated'] ) : null;
|
||||
$schema['itemReviewed']['dateCreated'] = ! empty( $data['bsf-aiosrs-movie-dateCreated'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-movie-dateCreated'] ) : NULL;
|
||||
if ( isset( $data['bsf-aiosrs-movie-director-name'] ) && ! empty( $data['bsf-aiosrs-movie-director-name'] ) ) {
|
||||
$schema['itemReviewed']['director']['@type'] = 'Person';
|
||||
$schema['itemReviewed']['director']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-movie-director-name'] );
|
||||
$schema['itemReviewed']['director']['name'] = wp_strip_all_tags( (string)$data['bsf-aiosrs-movie-director-name'] );
|
||||
}
|
||||
$schema['description'] = ! empty( $data['bsf-aiosrs-movie-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-movie-description'] ) : null;
|
||||
$schema['description'] = ! empty( $data['bsf-aiosrs-movie-description'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-movie-description'] ) : NULL;
|
||||
|
||||
break;
|
||||
case 'bsf-aiosrs-organization':
|
||||
$schema['itemReviewed']['@type'] = 'Organization';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-organization-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-organization-name'] ) : null;
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-organization-name'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-organization-name'] ) : NULL;
|
||||
if ( ( isset( $data['bsf-aiosrs-organization-location-street'] ) && ! empty( $data['bsf-aiosrs-organization-location-street'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-organization-location-locality'] ) && ! empty( $data['bsf-aiosrs-organization-location-locality'] ) ) ||
|
||||
( isset( $data['bsf-aiosrs-organization-location-postal'] ) && ! empty( $data['bsf-aiosrs-organization-location-postal'] ) ) ||
|
||||
@@ -307,11 +307,11 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
|
||||
$schema['itemReviewed']['address']['@type'] = 'PostalAddress';
|
||||
|
||||
$schema['itemReviewed']['address']['streetAddress'] = ! empty( $data['bsf-aiosrs-organization-location-street'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-organization-location-street'] ) : null;
|
||||
$schema['itemReviewed']['address']['addressLocality'] = ! empty( $data['bsf-aiosrs-organization-location-locality'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-organization-location-locality'] ) : null;
|
||||
$schema['itemReviewed']['address']['postalCode'] = ! empty( $data['bsf-aiosrs-organization-location-postal'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-organization-location-postal'] ) : null;
|
||||
$schema['itemReviewed']['address']['addressRegion'] = ! empty( $data['bsf-aiosrs-organization-location-region'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-organization-location-region'] ) : null;
|
||||
$schema['itemReviewed']['address']['addressCountry'] = ! empty( $data['bsf-aiosrs-organization-location-country'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-organization-location-country'] ) : null;
|
||||
$schema['itemReviewed']['address']['streetAddress'] = ! empty( $data['bsf-aiosrs-organization-location-street'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-organization-location-street'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['addressLocality'] = ! empty( $data['bsf-aiosrs-organization-location-locality'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-organization-location-locality'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['postalCode'] = ! empty( $data['bsf-aiosrs-organization-location-postal'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-organization-location-postal'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['addressRegion'] = ! empty( $data['bsf-aiosrs-organization-location-region'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-organization-location-region'] ) : NULL;
|
||||
$schema['itemReviewed']['address']['addressCountry'] = ! empty( $data['bsf-aiosrs-organization-location-country'] ) ? wp_strip_all_tags( (string)$data['bsf-aiosrs-organization-location-country'] ) : NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -321,13 +321,13 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
|
||||
if ( isset( $data['rating'] ) && ! empty( $data['rating'] ) ) {
|
||||
$schema['reviewRating']['@type'] = 'Rating';
|
||||
$schema['reviewRating']['ratingValue'] = wp_strip_all_tags( (string) $data['rating'] );
|
||||
$schema['reviewRating']['ratingValue'] = wp_strip_all_tags( (string)$data['rating'] );
|
||||
}
|
||||
$schema['reviewBody'] = ! empty( $data['review-body'] ) ? wp_strip_all_tags( (string) $data['review-body'] ) : null;
|
||||
$schema['datePublished'] = ! empty( $data['date'] ) ? wp_strip_all_tags( (string) $data['date'] ) : null;
|
||||
$schema['author']['@type'] = ! empty( $data['reviewer-type'] ) ? wp_strip_all_tags( (string) $data['reviewer-type'] ) : 'Person';
|
||||
$schema['reviewBody'] = ! empty( $data['review-body'] ) ? wp_strip_all_tags( (string)$data['review-body'] ) : NULL;
|
||||
$schema['datePublished'] = ! empty( $data['date'] ) ? wp_strip_all_tags( (string)$data['date'] ) : NULL;
|
||||
$schema['author']['@type'] = ! empty( $data['reviewer-type'] ) ? wp_strip_all_tags( (string)$data['reviewer-type'] ) : 'Person';
|
||||
if ( isset( $data['reviewer-name'] ) && ! empty( $data['reviewer-name'] ) ) {
|
||||
$schema['author']['name'] = wp_strip_all_tags( (string) $data['reviewer-name'] );
|
||||
$schema['author']['name'] = wp_strip_all_tags( (string)$data['reviewer-name'] );
|
||||
$author_data = get_userdata( $post['post_author'] );
|
||||
$author_name = ( isset( $author_data->user_nicename ) ) ? $author_data->user_nicename : '';
|
||||
$author_url = get_author_posts_url( $post['ID'] );
|
||||
@@ -337,7 +337,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
}
|
||||
if ( isset( $data['publisher-name'] ) && ! empty( $data['publisher-name'] ) ) {
|
||||
$schema['publisher']['@type'] = 'Organization';
|
||||
$schema['publisher']['name'] = wp_strip_all_tags( (string) $data['publisher-name'] );
|
||||
$schema['publisher']['name'] = wp_strip_all_tags( (string)$data['publisher-name'] );
|
||||
$prg_url_value = get_bloginfo( 'url' );
|
||||
$schema['publisher']['sameAs'] = esc_url( $prg_url_value );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user