Automattic\WooCommerce\Internal\Orders
OrderAttributionController::set_order_source_data
Save source data for an Order object.
Метод класса: OrderAttributionController{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->set_order_source_data( $source_data, $order );
- $source_data(массив) (обязательный)
- The source data.
- $order(WC_Order) (обязательный)
- The order object.
Код OrderAttributionController::set_order_source_data() OrderAttributionController::set order source data WC 10.7.0
private function set_order_source_data( array $source_data, WC_Order $order ) {
// If all the values are empty, bail.
if ( empty( array_filter( $source_data ) ) ) {
return;
}
foreach ( $source_data as $key => $value ) {
$order->add_meta_data( $this->get_meta_prefixed_field_name( $key ), $value );
}
$order->save_meta_data();
}