Automattic\WooCommerce\Database\Migrations\CustomOrderTable
PostsToOrdersMigrationController::maybe_clear_order_datastore_cache_for_ids
Clear the cache of order data for modified orders during migration if cache is enabled.
Method of the class: PostsToOrdersMigrationController{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->maybe_clear_order_datastore_cache_for_ids( $order_post_ids );
- $order_post_ids(array) (required)
- List of order IDs of the orders to clear from cache.
PostsToOrdersMigrationController::maybe_clear_order_datastore_cache_for_ids() PostsToOrdersMigrationController::maybe clear order datastore cache for ids code WC 10.4.3
private function maybe_clear_order_datastore_cache_for_ids( array $order_post_ids ) {
if ( OrderUtil::custom_orders_table_datastore_cache_enabled() ) {
$orders_table_datastore = wc_get_container()->get( OrdersTableDataStore::class );
if ( is_callable( array( $orders_table_datastore, 'clear_cached_data' ) ) ) {
$orders_table_datastore->clear_cached_data( $order_post_ids );
}
}
}