Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119378

sgatz on "JSON API Times Out"

$
0
0

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/


Viewing all articles
Browse latest Browse all 119378

Trending Articles