Allow saving of empty download expiry date, closes #773

This commit is contained in:
Gerhard 2015-03-16 14:53:59 +02:00
parent e7429e24de
commit 0e8ef24003
1 changed files with 3 additions and 5 deletions

View File

@ -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';
}
$wpdb->update( $wpdb->prefix . "woocommerce_downloadable_product_permissions",
$data,