Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::delete_order_data_from_custom_order_tables
Deletes order data from custom order tables.
Метод класса: OrdersTableDataStore{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$OrdersTableDataStore = new OrdersTableDataStore(); $OrdersTableDataStore->delete_order_data_from_custom_order_tables( $order_id );
- $order_id(int) (обязательный)
- The order ID.
Код OrdersTableDataStore::delete_order_data_from_custom_order_tables() OrdersTableDataStore::delete order data from custom order tables WC 10.3.4
public function delete_order_data_from_custom_order_tables( $order_id ) {
global $wpdb;
$order_cache = wc_get_container()->get( OrderCache::class );
// Delete COT-specific data.
foreach ( $this->get_all_table_names() as $table ) {
$wpdb->delete(
$table,
( self::get_orders_table_name() === $table )
? array( 'id' => $order_id )
: array( 'order_id' => $order_id ),
array( '%d' )
);
$order_cache->remove( $order_id );
}
$this->clear_cached_data( array( $order_id ) );
}