Support » Plugin: JSON API » [Plugin: JSON API] Querying custom taxonomy on custom post type causes fatal error

  • When querying for a custom taxonomy:

    Fatal error: Call to undefined method JSON_API_Core_Controller::error() in /Users/ben/Sites/buylocal/wp-content/plugins/json-api/singletons/api.php on line 54

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author dphiffer


    I will look into this! Thanks for the bug report.

    I’m also wondering if you have any plans to add support for caching? This is a great plugin but I really need it to support custom taxonomy queries and caching. In fact I’ll probably end up coding it myself since I don’t see any other decent JSON WordPress plugins. If I extend the plugin would you be interested in having that code?

    Plugin Author dphiffer


    Yeah, I’d be happy to look at a patch for something like this. And let me know if you have any questions I might be able to help with.

    anybody knows how to get the custom taxonomies into the json?
    Thanks in advance

    Hi guys,

    I got custom code to retrieve custom taxonomy, I added this piece code to the file category-template.php line 95

    // $categories = wp_get_object_terms( $id, ‘category’ );
    // CHANGE TO
    $args = array(‘public’ => true);
    $output = ‘names’; // or objects
    $operator = ‘and’; // ‘and’ or ‘or’
    $taxonomies = get_taxonomies($args, $output, $operator);

    $categories = wp_get_object_terms( $id, $taxonomies);
    // END

    I hope this will help you guys

    Plugin Author dphiffer


    So it sounds like this is a fix that needs to be made to the WordPress core? Anyone want to take a shot at posting a ticket to Trac? Or is there one already?

    It works like a charm, but changing the core is not the most preferred solution. Maybe posting a ticket is the right way to go

    Plugin Author dphiffer


    Go for it Jonas 🙂

    Also, to finally answer Ben’s original question, I don’t have any plans to expand the feature set any time soon. Long-term though, yeah, definitely. As I said, I’m happy to take a look at patch submissions.

    This trac thing is not really my natural habitat. Anybody got some expirience to post is there?

    Moderator Andrew Nacin


    Lead Developer

    The codebase for the plugin looks pretty foreign so I can’t help diagnose, but I don’t think this is a core bug.

    That line no longer exists in WordPress 3.1, first. Second, likely the get_the_category() function is being used when get_the_terms() would be more appropriate.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: JSON API] Querying custom taxonomy on custom post type causes fatal error’ is closed to new replies.