WordPress.org

Ready to get started?Download WordPress

Forums

Displaying JSON.. how? (3 posts)

  1. dyerrington
    Member
    Posted 4 years ago #

    Is there a way I can just echo out a JSON string and nothing else from a query parameter or using some sort of custom action?

    I know actions work by hooking into predefined wp named events or by initiating do_action() from a template. I just want to select some stuff from the database using the $wpdb object and then parse out some JSON..

    Any advice appreciated.

  2. dyerrington
    Member
    Posted 4 years ago #

    Also, I'm wanting to use my already developed JSON class, not the one that comes with WordPress..

  3. dyerrington
    Member
    Posted 4 years ago #

    WordPress is a pain in the ass.. I am going to use PEAR MDB2 and save myself the headache of duct taping this solution. I created a page, applied a custom template to it, bound an action then executed it within the template. The performance was awful, maxing out at less then 20 concurrent requests when I tested under load.

    I can write a simple class that connects to a database, selects WP data then have a few methods to display what to output and encode to JSON in less then 30 minutes of development. All while supporting a high number of requests (without caching).

    Problem solved! Thanks me!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags