Created
May 21, 2019 09:55
-
-
Save remcotolsma/ee3fca0527b67d521ee05ec96029f031 to your computer and use it in GitHub Desktop.
Dita adresses to JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$addresses = array(); | |
foreach ( $data as $item ) { | |
$addresses[] = (object) array( | |
'company' => 'First Company', | |
'address' => 'First Address', | |
'city' => 'First City', | |
'postcode' => 'First Postal', | |
'country_code' => 'NL', | |
'notes' => 'First Notes', | |
); | |
} | |
update_user_meta( $user_id, '_dita_shipping_addresses', wp_json_encode( $addresses ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment