Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::get_filter_type_arguments()protectedWC 1.0

Builds the type argument based on the current request.

Метод класса: ReviewsListTable{}

No Hooks.

Return

Array.

Usage

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

Code of ReviewsListTable::get_filter_type_arguments() WC 7.1.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;
}