WC_Customer_Download_Log_Data_Store::delete_by_permission_id()publicWC 3.4.0

Method to delete download logs for a given permission ID.

Метод класса: WC_Customer_Download_Log_Data_Store{}

Хуков нет.

Возвращает

null. Ничего.

Использование

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

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

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

Код WC_Customer_Download_Log_Data_Store::delete_by_permission_id() WC 7.3.0

public function delete_by_permission_id( $id ) {
	global $wpdb;
	$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE permission_id = %d", $id ) );
	// Delete related records in wc_download_log (aka ON DELETE CASCADE).
	$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}wc_download_log WHERE permission_id = %d", $id ) );
}