WC_Customer_Download_Data_Store::delete_by_order_id()publicWC 1.0

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

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

Хуков нет.


null. Ничего (null).


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

Код WC_Customer_Download_Data_Store::delete_by_order_id() WC 9.0.2

public function delete_by_order_id( $id ) {
	global $wpdb;
	// Delete related records in wc_download_log (aka ON DELETE CASCADE).
	$this->delete_download_log_by_field_value( 'order_id', $id );

			"DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions
			WHERE order_id = %d",