Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::set_review_type()protectedWC 1.0

Sets the $comment_type global based on the current request.

Method of the class: ReviewsListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Notes

  • Global. String. $comment_type

ReviewsListTable::set_review_type() code WC 8.6.1

protected function set_review_type() : void {
	global $comment_type;

	$review_type = sanitize_text_field( wp_unslash( $_REQUEST['review_type'] ?? 'all' ) );

	if ( 'all' !== $review_type && ! empty( $review_type ) ) {
		$comment_type = $review_type; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
	}
}