WC_Helper::get_current_filter()public staticWC 1.0

Get current filter.

Method of the class: WC_Helper{}

No Hooks.

Return

String. The current filter.

Usage

$result = WC_Helper::get_current_filter();

WC_Helper::get_current_filter() code WC 9.8.2

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;
}