Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Build a WordPress Plugin Connecting WordPress Plugins with 3rd Party APIs Parsing JSON with PHP: Part 1

Elizabeth Prescott
Elizabeth Prescott
856 Points

How would we parse the JSON *before* writing it to the database? If we want to create posts from it, for example.

I'm attempting to create posts based on a JSON feed from another API. I learned that I need to use post_meta in place of the option functions to do this, but it sounds like each result of the feed needs to be stored in a new row in the database? Help!

John Alarcon
John Alarcon
14,458 Points

Yes, you should store the JSON feeds, one feed per row. You can easily have the record update once per day, or whenever the page is visited, whichever is least frequent.