Adds new hook to allow customize downlodable file permissions
This is needed on Product Custom Tables in order to allow control expire and remaining downloads per file.
This commit is contained in:
parent
4a6c526229
commit
4c6641ab6a
|
@ -366,6 +366,8 @@ function wc_downloadable_file_permission( $download_id, $product, $order, $qty =
|
||||||
$download->set_access_expires( strtotime( $from_date . ' + ' . $expiry . ' DAY' ) );
|
$download->set_access_expires( strtotime( $from_date . ' + ' . $expiry . ' DAY' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$download = apply_filters( 'woocommerce_downloadable_file_permission', $download, $product, $order, $qty );
|
||||||
|
|
||||||
return $download->save();
|
return $download->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue