[Plugin: JSON API] fetch all custom_fields by JSON-API
-
I want to fetch all custom_fields by JSON-API
I have done some changes to the Post.php
`
function set_custom_fields_value() {
global $json_api;
if ($json_api->include_value(‘custom_fields’) &&
$json_api->query->custom_fields) {
$keys = explode(‘,’, $json_api->query->custom_fields);
if (in_array(“all”, $keys)) {
$keys=get_meta_keys();
}
$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);
}
}you have just to add this line custom_fields=all and everything works
is it possible to include this in the next release ?
The topic ‘[Plugin: JSON API] fetch all custom_fields by JSON-API’ is closed to new replies.