WC_Admin_List_Table_Coupons::query_filters()protectedWC 1.0

Handle any custom filters.

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

Хуков нет.

Возвращает

Массив.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->query_filters( $query_vars );
$query_vars(массив) (обязательный)
Query vars.

Код WC_Admin_List_Table_Coupons::query_filters() WC 8.7.0

protected function query_filters( $query_vars ) {
	if ( ! empty( $_GET['coupon_type'] ) ) { // WPCS: input var ok, sanitization ok.
		$query_vars['meta_key']   = 'discount_type'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key
		$query_vars['meta_value'] = wc_clean( wp_unslash( $_GET['coupon_type'] ) ); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value, WordPress.VIP.SuperGlobalInputUsage.AccessDetected
	}
	return $query_vars;
}