WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
JSON API Times Out (1 post)

  1. sgatz
    Member
    Posted 1 year ago #

    we use JSON API and created some custom methods to fetch a custom feild. In actual use, the api times out with a 500 error more than it works. It's really unusable. Any advice?

    one custom function is:

    public function get_category_posts() {
    global $json_api;
    $category = $json_api->introspector->get_current_category();
    if (!$category) {
    $json_api->error("Not found.");
    }
    $posts = $json_api->introspector->get_posts(array(
    'cat' => $category->id,
    'posts_per_page' => 15
    ));
    return array('posts' => self::format_posts($posts, $category->title));
    }

    format posts fetches the custom field and an image for the post.

    http://wordpress.org/extend/plugins/json-api/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.