Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::get_filter_type_arguments()protectedWC 1.0

Builds the type argument based on the current request.

Method of the class: ReviewsListTable{}

No Hooks.

Return

Array.

Usage

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

ReviewsListTable::get_filter_type_arguments() code WC 8.7.0

protected function get_filter_type_arguments() : array {

	$args      = [];
	$item_type = isset( $_REQUEST['review_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['review_type'] ) ) : 'all';

	if ( 'all' === $item_type ) {
		return $args;
	}

	$args['type'] = $item_type;

	return $args;
}