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 trialmattlitzinger
5,776 PointsStoring Instagram JSON feed in WordPress options table
I am having issues storing the Instagram access token and json feed in a serialized WordPress options table. Everything seems to be stored correctly, but when I use get_option() to retrieve the data, it returns a string containing the letter 'a'. Any ideas?
Notes:
- I am using base64_encode() to secure the data and base64_decode() to unencrypt it on the return. However, the issue has existed since before I used this method.
- The Instagram access token does include periods (full stops) in the string.
mattlitzinger
5,776 PointsHere is my working version. Previously I was trying to include the JSON feed in the same wp_option row as the access_token. Still not sure why that doesn't work. https://dl.dropboxusercontent.com/u/13611436/instagram-feed.zip
5 Answers
mattlitzinger
5,776 PointsHere is a link to the table row with the json included: http://pastebin.com/jZEZMbac I have since removed the json from the row and calculated it on each page load. Any idea why the json would make get_option() return as a string?
Colin Lewis
9,021 PointsI was going to take a look, but the zip in invalid, I can't open it to look at your code.
mattlitzinger
5,776 PointsSorry about that, try this: http://dev.mlitzinger.com/tools/instagram-feed.zip
Zac Gordon
Treehouse Guest TeacherWhat does it look like in the DB when you first save it (using something like phpMyAdmin to look at the DB directly? Sounds like you're getting back a weird snippet of the serialized array.
Anthony Moore
2,282 PointsWhat does the full code look like when trying to show the instagram images?
Jerry Lopez
8,128 PointsJerry Lopez
8,128 PointsAre you creating a plugin? If so, would you be able to provide me a download link so I can install and give a shot at figuring this out for you?