Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::set_review_status()protectedWC 1.0

Sets the $comment_status global based on the current request.

Method of the class: ReviewsListTable{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_review_status() : void;

Notes

  • Global. String. $comment_status

ReviewsListTable::set_review_status() code WC 7.1.0

protected function set_review_status() : void {
	global $comment_status;

	$comment_status = sanitize_text_field( wp_unslash( $_REQUEST['comment_status'] ?? 'all' ) ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited

	if ( ! in_array( $comment_status, [ 'all', 'moderated', 'approved', 'spam', 'trash' ], true ) ) {
		$comment_status = 'all'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
	}
}