Array filter Closes #38.

This commit is contained in:
Mike Jolley 2011-10-04 11:02:55 +01:00
parent c0e3af9c63
commit 3985ec269b
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class woocommerce_coupon {
$this->type = get_post_meta($coupon->ID, 'discount_type', true);
$this->amount = get_post_meta($coupon->ID, 'coupon_amount', true);
$this->individual_use = get_post_meta($coupon->ID, 'individual_use', true);
$this->product_ids = array_map('trim', explode(',', get_post_meta($coupon->ID, 'product_ids', true)));
$this->product_ids = array_filter(array_map('trim', explode(',', get_post_meta($coupon->ID, 'product_ids', true))));
$this->usage_limit = get_post_meta($coupon->ID, 'usage_limit', true);
$this->usage_count = (int) get_post_meta($coupon->ID, 'usage_count', true);
$this->expiry_date = ($expires = get_post_meta($coupon->ID, 'expiry_date', true)) ? strtotime($expires) : '';