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
if ( !function_exists( 'wc_review_is_from_verified_owner' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-user-functions.php'; } // The comment id. $comment_id = -1; // NOTICE! Understand what this does before running. $result = wc_review_is_from_verified_owner($comment_id);
Defined (1)
The function is defined in the following location(s).
- /includes/wc-user-functions.php
- function wc_review_is_from_verified_owner( $comment_id ) {
- $verified = get_comment_meta( $comment_id, 'verified', true );
- // If no "verified" meta is present, generate it (if this is a product review).
- if ( '' === $verified ) {
- $verified = WC_Comments::add_comment_purchase_verification( $comment_id );
- }
- return (bool) $verified;
- }