Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

S Ananda
S Ananda
9,474 Points

Not most recent...

I just noticed something in this course. I just put in my own username and it brought up my badges just fine. However, they are NOT the 20 most recent, but starting from when I started at treehouse. They are in fact, the 20 oldest courses I've completed.

I think there must be a line of code that should be added in order to get the date sequence correct. If anyone has figured out, please share and illuminate us other plugin developer students.

Once I finish the course I may come back and see if I can figure out how to fix this date problem.

2 Answers

S Ananda
S Ananda
9,474 Points

Now that I'm in the section on widgets he is showing the correct code for getting the most recent badges.

Dan Weru
Dan Weru
47,637 Points

I haven’t tackled the exercise for this particular course. That said, treehouse stores the badges and other user’s data in an object. Last time I checked, this object had the badges with their respective dates (when they were gained). The line you’re looking for could be solved using this info. You could query based on the dates.

Hopefully that’s a good start.