Мне нужно отправить массив на сервер, почему-то отправляется [Object object], если смотреть через console.log то вывод нормальный, но на сервере уже [Object object]
array_setting = {
addresses: [
{
type: 'home',
street1: $('.block-info #street1').text(),
street2: $('.block-info #street2').text(),
city: $('.block-info #city').text(),
state: $('.block-info #state').text(),
zip_code: $('.block-info #zipCode').text(),
country: $('.block-info #country').text()
}
],
date_of_birth: $('.block-info #dateOfBirth').text(),
emails: [
{
type: 'default',
email: $('.block-info #email').text()
}
],
gender: {
"id": $('.block-info #gender').attr('data-id'),
},
name: {
first_name: $('.block-info #firstName').text(),
last_name: $('.block-info #lastName').text(),
preferred_name: ""
},
phones: [
{
type: 'emergency',
area_code: $('.block-info #phoneEmergency').attr('data-code'),
number: $('.block-info #phoneEmergency').attr('data-number'),
extension: "",
},
{
type: "home",
area_code: $('.block-info #phoneEmergency').attr('data-code'),
number: $('.block-info #phoneEmergency').attr('data-number'),
extension: "",
}
],
};
$.ajax({
url: '<?php echo admin_url( "admin-ajax.php" ) ?>',
type: 'POST',
data: 'action=editAccount&settings=' + array_setting,
success: function( data ) {
console.log(data);
}
});