The example provided demonstrates the data structure for output requests made by the WP Data Sync API.
WordPress Data Array
$wordpress = [
'primary_id' => [
'meta_key' => 'key',
'meta_value' => 'value'
],
'post_object' => [
'post_title' => 'string',
'post_type' => 'string',
// Etc...
],
'post_meta' => [
'key' => 'value',
'key' => 'value'
],
'taxonomies' => [
'taxonomy' => [
['term_i'] => [
'term' => 'string',
'parents' => [
'parent',
'parent'
]
]
]
],
'post_thumbnail' => 'URL string',
];
WooCommerce Data Array
$woocommerce = [
'product_gallery' => [
'URL string',
'URL string'
],
'attributes' => [
['attribute_1'] => [
'name' => 'string',
'values' => [
'string',
'string',
'string'
],
'is_visible' => 'bool',
'is_taxonomy' => 'bool',
'is_variation' => 'bool'
]
],
'variations' => [
['variation_1'] => [
'post_object' => [
'post_title' => 'string',
'post_type' => 'string',
// Etc...
],
'post_meta' => [
'key' => 'value',
'key' => 'value'
],
'post_thumbnail' => 'string'
]
],
'cross_sells' => [
'sell_id' => 'string',
'sell_ids' => [
'string',
'string'
],
'relational_key' => 'string'
],
'up_sells' => [
'sell_id' => 'string',
'sell_ids' => [
'string',
'string'
],
'relational_key' => 'string'
]
];
Data
$data = array_merge( $wordpress, $woocommerce );