From 0e8ef24003bcce89b394129fb04dcfc03b766171 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Mon, 16 Mar 2015 14:53:59 +0200 Subject: [PATCH] Allow saving of empty download expiry date, closes #773 --- .../meta-boxes/class-wc-meta-box-order-downloads.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-downloads.php b/includes/admin/meta-boxes/class-wc-meta-box-order-downloads.php index 27a4bb99250..881dec86046 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-downloads.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-downloads.php @@ -109,12 +109,10 @@ class WC_Meta_Box_Order_Downloads { $format = array( '%d', '%s', '%s' ); - $expiry = ( array_key_exists( $i, $access_expires ) && $access_expires[ $i ] != '' ) ? date_i18n( 'Y-m-d', strtotime( $access_expires[ $i ] ) ) : null; + $expiry = ( array_key_exists( $i, $access_expires ) && '' != $access_expires[ $i ] ) ? date_i18n( 'Y-m-d', strtotime( $access_expires[ $i ] ) ) : null; - if ( ! is_null( $expiry ) ) { - $data['access_expires'] = $expiry; - $format[] = '%s'; - } + $data['access_expires'] = $expiry; + $format[] = '%s'; $wpdb->update( $wpdb->prefix . "woocommerce_downloadable_product_permissions", $data,