WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Querying custom taxonomy on custom post type causes fatal error (11 posts)

  1. benknight
    Member
    Posted 3 years ago #

    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

  2. dphiffer
    Member
    Plugin Author

    Posted 3 years ago #

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

  3. benknight
    Member
    Posted 3 years ago #

    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?

  4. dphiffer
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  5. JonasVorwerk
    Member
    Posted 3 years ago #

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

  6. rujakz
    Member
    Posted 3 years ago #

    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

  7. dphiffer
    Member
    Plugin Author

    Posted 3 years ago #

    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?

    http://core.trac.wordpress.org/newticket

  8. JonasVorwerk
    Member
    Posted 3 years ago #

    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

  9. dphiffer
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  10. JonasVorwerk
    Member
    Posted 3 years ago #

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

  11. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags