Viewing 1 replies (of 1 total)
  • For me, all the custom field data is coming back automatically.

    In model/posts.php do you have this code:

    function set_custom_fields_value() {
        global $json_api;
        if ($json_api->include_value('custom_fields')) {
          $wp_custom_fields = get_post_custom($this->id);
          $this->custom_fields = new stdClass();
          if ($json_api->query->custom_fields) {
            $keys = explode(',', $json_api->query->custom_fields);
          }
          foreach ($wp_custom_fields as $key => $value) {
            if ($json_api->query->custom_fields) {
              if (in_array($key, $keys)) {
                $this->custom_fields->$key = $wp_custom_fields[$key];
              }
            } else if (substr($key, 0, 1) != '_') {
              $this->custom_fields->$key = $wp_custom_fields[$key];
            }
          }
        } else {
          unset($this->custom_fields);
        }
      }
Viewing 1 replies (of 1 total)
  • The topic ‘Couldn't get all custom fields’ is closed to new replies.