Automattic\WooCommerce\Internal\Admin\ProductReviews
Reviews::is_review_or_reply()
Determines if the object is a review or a reply to a review.
Method of the class: Reviews{}
Hooks from the method
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() Reviews::is review or reply code WC 9.6.1
protected function is_review_or_reply( $object ): bool { $is_review_or_reply = $object instanceof WP_Comment && in_array( $object->comment_type, array( '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 ); }