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 trialJason Moore
Courses Plus Student 10,297 PointsChallenge 4 out of 6 / How to Create WordPress Widgets
Hello and good day, I am attempting to the challenge that read:
Inside of the widget function, below the extract function, apply the widget_title filter to get the title of the instance. Assign it to a variable named title.
Below is the code I entered.
function widget( $args, $instance ) {
// Widget output
extract($args);
// EDIT - removed correct answer ;)
}
The code I entered is coming up incorrect, and is giving me this as an explanation: "The first thing inside the widget method, use the extract function to make $args into local variables."
Please let me know if I am making a mistake. Thank you kindly.
1 Answer
Zac Gordon
Treehouse Guest TeacherGlad you sorted it out! Going to edit out your answer for future references not to give away everything ;)
Jason Moore
Courses Plus Student 10,297 PointsSounds good! I appreciate the time and work you all put in to help us.
Jason Moore
Courses Plus Student 10,297 PointsJason Moore
Courses Plus Student 10,297 PointsNever mind, I figured it out. In case anyone has the same problem, just delete the comment below :
// Widget output
I copied this comment from the WordPress Codex, but leave it out for this exercise.