I'm building a Javascript application that will do cool things with JSON data dumped from a client's Wordpress. It's working great except for parts that are in this PHP-style serialized data that I can't figure out how to deal with in Javascript. Can someone recommend a good method for this?
I was excited when I discovered the
JSON API plugin for Wordpress, which lets WP produce data that is workable in Javascript applications like the one I am making.
Some of the data is easy to work with, like the "title" field. It shows up as a nice JSON string that I can work with. But many of the other Custom Fields are coming out as serialized data, like this:
"a:1:{s:39:"wpcf-fields-checkboxes-option-154377028";s:6:"medium";}"
I wonder if someone might be able to recommend either a good way of unserializing this in Javascript, or plugging something into the JSON API so that it filters and unserializes PHP before it gets dumped, or a better JSON API for Wordpress that does not do this?
I have been looking around on the Web and saw that there is a function called JSON.Parse that I was trying to use but couldn't figure out how to make it produce the right results or if it was what I should be using.
Any help much appreciated.
posted by migurski at 1:42 PM on November 5, 2012 [1 favorite]