Automattic\WooCommerce\Internal\OrderReviews

SubmissionHandler::clear_auto_rejected_flag │ public │ WC 1.0

Drop the automatic-rejection tag when a tagged review's status later changes.

A moderator confirming the rejection (or our own re-moderation approving a resubmission) is the final word, so the row should no longer be skipped by has_rejected_review(). Our own auto-rejection sets the tag after the status transition, so it is not affected.

Method of the class: SubmissionHandler{}

No Hooks.

Returns

null. Nothing (null).

Usage

$SubmissionHandler = new SubmissionHandler();
$SubmissionHandler->clear_auto_rejected_flag( $new_status, $old_status, $comment ): void;
$new_status(int|string) (required)
New comment status.
$old_status(int|string) (required)
Old comment status.
$comment(WP_Comment) (required)
The comment whose status changed.

SubmissionHandler::clear_auto_rejected_flag() code WC 11.1.2

public function clear_auto_rejected_flag( $new_status, $old_status, $comment ): void {
	unset( $new_status, $old_status );
	if ( ! $comment instanceof \WP_Comment || 'review' !== $comment->comment_type ) {
		return;
	}
	if ( get_comment_meta( (int) $comment->comment_ID, self::AUTO_REJECTED_META_KEY, true ) ) {
		delete_comment_meta( (int) $comment->comment_ID, self::AUTO_REJECTED_META_KEY );
	}
}