Automattic\WooCommerce\Internal\Admin\ProductReviews

Reviews::is_review_or_reply()protectedWC 1.0

Determines if the object is a review or a reply to a review.

Method of the class: Reviews{}

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_review_or_reply( $object ) : bool;
$object(WP_Comment|mixed) (required)
Object to check.

Reviews::is_review_or_reply() code WC 7.1.1

protected function is_review_or_reply( $object ) : bool {

	$is_review_or_reply = $object instanceof WP_Comment && in_array( $object->comment_type, [ 'review', 'comment' ], true ) && get_post_type( $object->comment_post_ID ) === 'product';

	/**
	 * Filters whether the object is a review or a reply to a review.
	 *
	 * @since 6.7.0
	 *
	 * @param bool             $is_review_or_reply Whether the object in context is a review or a reply to a review.
	 * @param WP_Comment|mixed $object             The object in context.
	 */
	return (bool) apply_filters( 'woocommerce_product_reviews_is_product_review_or_reply', $is_review_or_reply, $object );
}