WC_Helper::get_current_filter()public staticWC 1.0

Get current filter.

{} It's a method of the class: WC_Helper{}

No Hooks.

Return

String. The current filter.

Usage

$result = WC_Helper::get_current_filter();

Code of WC_Helper::get_current_filter() WC 6.6.1

public static function get_current_filter() {
	$current_filter = 'all';
	$valid_filters  = array_keys( self::get_filters() );

	if ( ! empty( $_GET['filter'] ) && in_array( wp_unslash( $_GET['filter'] ), $valid_filters ) ) {
		$current_filter = wc_clean( wp_unslash( $_GET['filter'] ) );
	}

	return $current_filter;
}