Return verification status in WC_Comments::add_comment_purchase_verification().

This commit is contained in:
Jeff Stieler 2015-10-09 10:21:40 -06:00
parent a34d58c18f
commit e9bfa2553c
1 changed files with 4 additions and 1 deletions

View File

@ -296,13 +296,16 @@ class WC_Comments {
/**
* Determine if a review is from a verified owner at submission.
* @param int $comment_id
* @return bool
*/
public static function add_comment_purchase_verification( $comment_id ) {
$comment = get_comment( $comment_id );
$comment = get_comment( $comment_id );
$verified = false;
if ( 'product' === get_post_type( $comment->comment_post_ID ) ) {
$verified = wc_customer_bought_product( $comment->comment_author_email, $comment->user_id, $comment->comment_post_ID );
add_comment_meta( $comment_id, 'verified', (int) $verified, true );
}
return $verified;
}
}