Allow saving of empty download expiry date, closes #773
This commit is contained in:
parent
e7429e24de
commit
0e8ef24003
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue