Merge pull request #25667 from jacoswan/fix-25666
Fix 25666 - Schema rating markup is missing required bestRating and worstRating
This commit is contained in:
commit
bfac625cdc
|
@ -305,7 +305,9 @@ class WC_Structured_Data {
|
||||||
'@type' => 'Review',
|
'@type' => 'Review',
|
||||||
'reviewRating' => array(
|
'reviewRating' => array(
|
||||||
'@type' => 'Rating',
|
'@type' => 'Rating',
|
||||||
|
'bestRating' => '5',
|
||||||
'ratingValue' => get_comment_meta( $comment->comment_ID, 'rating', true ),
|
'ratingValue' => get_comment_meta( $comment->comment_ID, 'rating', true ),
|
||||||
|
'worstRating' => '1',
|
||||||
),
|
),
|
||||||
'author' => array(
|
'author' => array(
|
||||||
'@type' => 'Person',
|
'@type' => 'Person',
|
||||||
|
@ -350,7 +352,9 @@ class WC_Structured_Data {
|
||||||
if ( $rating ) {
|
if ( $rating ) {
|
||||||
$markup['reviewRating'] = array(
|
$markup['reviewRating'] = array(
|
||||||
'@type' => 'Rating',
|
'@type' => 'Rating',
|
||||||
|
'bestRating' => '5',
|
||||||
'ratingValue' => $rating,
|
'ratingValue' => $rating,
|
||||||
|
'worstRating' => '1',
|
||||||
);
|
);
|
||||||
} elseif ( $comment->comment_parent ) {
|
} elseif ( $comment->comment_parent ) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue