Merge pull request #7749 from javorszky/download-filter

Adds filter to download permissions results
This commit is contained in:
Mike Jolley 2015-04-01 16:27:07 +01:00
commit 5bce366d40
1 changed files with 2 additions and 2 deletions

View File

@ -385,7 +385,7 @@ function wc_get_customer_available_downloads( $customer_id ) {
$file_number = 0;
// Get results from valid orders only
$results = $wpdb->get_results( $wpdb->prepare( "
$results = apply_filters( 'woocommerce_permission_list', $wpdb->get_results( $wpdb->prepare( "
SELECT permissions.*
FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions as permissions
WHERE user_id = %d
@ -403,7 +403,7 @@ function wc_get_customer_available_downloads( $customer_id ) {
permissions.access_expires >= %s
)
ORDER BY permissions.order_id, permissions.product_id, permissions.permission_id;
", $customer_id, date( 'Y-m-d', current_time( 'timestamp' ) ) ) );
", $customer_id, date( 'Y-m-d', current_time( 'timestamp' ) ) ) ), $customer_id );
if ( $results ) {