Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::backfill_post_record()
Backfills order details in to WP_Post DB. Uses WC_Order_Data_store_CPT.
Метод класса: OrdersTableDataStore{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$OrdersTableDataStore = new OrdersTableDataStore(); $OrdersTableDataStore->backfill_post_record( $order );
- $order(\WC_Abstract_Order) (обязательный)
- Order object to backfill.
Код OrdersTableDataStore::backfill_post_record() OrdersTableDataStore::backfill post record WC 7.3.0
public function backfill_post_record( $order ) { $cpt_data_store = $this->get_post_data_store_for_backfill(); if ( is_null( $cpt_data_store ) || ! method_exists( $cpt_data_store, 'update_order_from_object' ) ) { return; } $cpt_data_store->update_order_from_object( $order ); foreach ( $cpt_data_store->get_internal_data_store_key_getters() as $key => $getter_name ) { if ( is_callable( array( $cpt_data_store, "set_$getter_name" ) ) && is_callable( array( $this, "get_$getter_name" ) ) ) { call_user_func_array( array( $cpt_data_store, "set_$getter_name", ), array( $order, $this->{"get_$getter_name"}( $order ), ) ); } } }