Merge pull request #25667 from jacoswan/fix-25666

Fix 25666 - Schema rating markup is missing required bestRating and worstRating
This commit is contained in:
Christopher Allford 2020-02-19 18:09:23 -08:00 committed by GitHub
commit bfac625cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -305,7 +305,9 @@ class WC_Structured_Data {
'@type' => 'Review',
'reviewRating' => array(
'@type' => 'Rating',
'bestRating' => '5',
'ratingValue' => get_comment_meta( $comment->comment_ID, 'rating', true ),
'worstRating' => '1',
),
'author' => array(
'@type' => 'Person',
@ -350,7 +352,9 @@ class WC_Structured_Data {
if ( $rating ) {
$markup['reviewRating'] = array(
'@type' => 'Rating',
'bestRating' => '5',
'ratingValue' => $rating,
'worstRating' => '1',
);
} elseif ( $comment->comment_parent ) {
return;