delete_by_user_id method for customer downloads
This commit is contained in:
parent
53a93fd3b1
commit
3f2d8e8eef
|
@ -225,6 +225,23 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to delete a download permission from the database by user ID.
|
||||||
|
*
|
||||||
|
* @since 3.4.0
|
||||||
|
* @param int $id user ID of the downloads that will be deleted.
|
||||||
|
*/
|
||||||
|
public function delete_by_user_id( $id ) {
|
||||||
|
global $wpdb;
|
||||||
|
$wpdb->query(
|
||||||
|
$wpdb->prepare(
|
||||||
|
"DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions
|
||||||
|
WHERE user_id = %d",
|
||||||
|
$id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a download object.
|
* Get a download object.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue