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:
Claudio Sanches 2018-03-29 13:58:40 -03:00
parent 4a6c526229
commit 4c6641ab6a
1 changed files with 2 additions and 0 deletions

View File

@ -366,6 +366,8 @@ function wc_downloadable_file_permission( $download_id, $product, $order, $qty =
$download->set_access_expires( strtotime( $from_date . ' + ' . $expiry . ' DAY' ) );
}
$download = apply_filters( 'woocommerce_downloadable_file_permission', $download, $product, $order, $qty );
return $download->save();
}