wc_review_is_from_verified_owner

Get review verification status.

Description

wc_review_is_from_verified_owner( (int) $comment_id ); 

Parameters (1)

0. $comment_id (int)
The comment id.

Usage

  1. if ( !function_exists( 'wc_review_is_from_verified_owner' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-user-functions.php'; 
  3.  
  4. // The comment id. 
  5. $comment_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_review_is_from_verified_owner($comment_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-user-functions.php  
  1. function wc_review_is_from_verified_owner( $comment_id ) { 
  2. $verified = get_comment_meta( $comment_id, 'verified', true ); 
  3.  
  4. // If no "verified" meta is present, generate it (if this is a product review). 
  5. if ( '' === $verified ) { 
  6. $verified = WC_Comments::add_comment_purchase_verification( $comment_id ); 
  7.  
  8. return (bool) $verified;