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 trialvaleriuv
20,999 PointsWhy does The Official Treehouse Badges Widget not work? (solved)
When I move the widget to the widget area, the round symbol shows that it keeps loading, and I cannot save it.
class Wptreehouse_Badges_Widget extends WP_Widget {
function wptreehouse_badges_widget() {
// Instantiate the parent object
parent::__construct( false, 'Official Treehouse Badges Widget' );
}
function widget( $args, $instance ) {
// Widget output
extract ( $args );
$title = apply_filters ('widget_title', $instance['title']);
$options = get_option ('wptreehouse_badges');
$wptreehouse_profile = $options['wptreehouse_profile'];
require('inc/front-end.php');
}
function update( $new_instance, $old_instance ) {
// Save widget options
$instance = $old_instance;
$instance['title'] = strip_tages($new_instance['title']);
return $instance;
}
function form( $instance ) {
// Output admin widget options form
$title = esc_attr($instance['title']);
require('inc/widget-fields.php');
}
}
function wptreehouse_badges_register_widgets() {
register_widget( 'Wptreehouse_Badges_Widget' );
}
add_action( 'widgets_init', 'wptreehouse_badges_register_widgets' );
1 Answer
Zac Gordon
Treehouse Guest TeacherMarking correct answer (from above):
"wrote strip_tages instead of strip_tags"
valeriuv
20,999 Pointsvaleriuv
20,999 PointsOK I found the bug:
I wrote strip_tages instead of strip_tags
Thanks!