Viewing 2 replies - 1 through 2 (of 2 total)
  • Probably, this will help you:

    wwwyourdomain/api/get_post/?json=get_recent_posts&include=title,date,type,slug,status,title_plain,content,excerpt,modified

    1 methode by include in url:

    http://www.yourdomain/api/get_post/?json=get_recent_posts&include=title,date,type,slug

    /////////////////////////////////////////////////

    2 methode add code in function:

    in core.php find your methode and add this code before return

    foreach ($posts as $post) {
    unset($post->status);
    unset($post->content);
    unset($post->comments);
    unset($post->attachments);
    unset($post->thumbnail_images);
    }

    // ——– for sample ————– //

    public function get_recent_posts() {
    global $json_api;
    $posts = $json_api->introspector->get_posts();
    foreach ($posts as $post) {
    unset($post->status);
    unset($post->content);
    unset($post->comments);
    unset($post->attachments);
    unset($post->thumbnail_images);
    }
    return $this->posts_result($posts);
    }

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove unnecessary fields from json response’ is closed to new replies.