Support » Plugins and Hacks » [Plugin: JSON API] Querying on multi-site instance

  • How can I get the JSON API to work across a multisite instance?

    I can only get results when I query with a specific post name, like:

    URLs that use the API methods, like this: /api/get_post/?id=314
    return this: {“status”:”error”,”error”:”Not found.”}

    Any help would be greatly appreciated.


Viewing 1 replies (of 1 total)
  • I recently needed a solution for this. Here is my fix.

    I added the following lines just below the included files of json-api.php

    if( isset($_GET['siteid']) ) {
    	global $site_id;
    	$site_id = $_GET['site_id'];

    You would just include the site id in your query string like so

    This was using wordpress 3.2.1

    I don’t think the global $site_id declaration was 100% necessary but shouldn’t hurt.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: JSON API] Querying on multi-site instance’ is closed to new replies.