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 trialJesse Janson
2,983 PointsStuck on Wordpress Plugin Challenge - Custom_Filter
Write an empty function named custom_filter(). Then add your function to the "the_content" filter.
<?php
function custom_filter( $content ) { return $content; }
add_filter(‘the_content’,'custom_filter’); ?>
4 Answers
Matt Campbell
9,767 PointsHi Jesse Janson
It's asking you to write an empty function which means the function isn't doing anything. Read your function and ask yourself, what is this function doing?
Blake Anneberg
23,304 PointsHaving same problem too... says Bummer! The wrong custom filter was passed to add_filter(). It should be named "custom_filter".
<?php
function custom_filter(){}
add_filter("the_content");
?> ```
Blake Anneberg
23,304 PointsSorry, just got it, I needed to put add_filter to include the content, custom filter
Claudia Flores-Saviaga
15,805 Points<?php
function custom_filter(){ } add_filter('the_content','custom_filter'); ?>