How to optimize update_post_meta?
To achieve what you want you’re better creating an associative array and then walking over it with a foreach loop as shown below : $data = array( ‘_shipping_first_name’ => $order->get_billing_first_name(), ‘_shipping_last_name’ => $order->get_billing_last_name(), ‘_shipping_company’ => $order->get_billing_company(), ‘_shipping_address_1’ => $order->get_billing_address_1(), ‘_shipping_address_2’ => $order->get_billing_address_2(), ‘_shipping_postcode’ => $order->get_billing_postcode(), ‘_shipping_city’ => $order->get_billing_city(), ‘_shipping_state’ => $order->get_billing_state(), ‘_shipping_country’ => $order->get_billing_country() ); … Read more