I changed the function called set_custom_fields_value in models->post.php to the following.
Now if you add ?json=1&custom_fields=all after the url it will return ALL custom values including woo data – make sure you want all the field returned!
function set_custom_fields_value() {
global $json_api;
if ($json_api->include_value('custom_fields') &&
$json_api->query->custom_fields) {
if($json_api->query->custom_fields == 'all') {
$wp_custom_fields = get_post_custom($this->id);
$this->custom_fields = new stdClass();
foreach ( $wp_custom_fields as $key => $value ){
$this->custom_fields->$key = $value;
}
} else {
$keys = explode(',', $json_api->query->custom_fields);
$wp_custom_fields = get_post_custom($this->id);
$this->custom_fields = new stdClass();
foreach ($keys as $key) {
if (isset($wp_custom_fields[$key])) {
$this->custom_fields->$key = $wp_custom_fields[$key];
}
}
}
} else {
unset($this->custom_fields);
}
}
[Please post code between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]