Automattic\WooCommerce\Internal\Admin\ProductReviews
ReviewsListTable::set_review_type
Sets the $comment_type global based on the current request.
Method of the class: ReviewsListTable{}
No Hooks.
Returns
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() ReviewsListTable::set review type code WC 10.8.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
}
}