WC_Customer_Download_Data_Store::delete_by_user_id()publicWC 3.4.0

Method to delete a download permission from the database by user ID.

{} Это метод класса: WC_Customer_Download_Data_Store{}

Хуков нет.


true|false. True if deleted rows.


$WC_Customer_Download_Data_Store = new WC_Customer_Download_Data_Store();
$WC_Customer_Download_Data_Store->delete_by_user_id( $id );
$id(int) (обязательный)
user ID of the downloads that will be deleted.

Список изменений

С версии 3.4.0 Введена.

Код WC_Customer_Download_Data_Store::delete_by_user_id() WC 6.4.1

public function delete_by_user_id( $id ) {
	global $wpdb;
	return (bool) $wpdb->query(
			"DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions
			WHERE user_id = %d",