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

Stuck 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
Matt Campbell
9,767 Points

Hi 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
Blake Anneberg
23,304 Points

Having 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
Blake Anneberg
23,304 Points

Sorry, just got it, I needed to put add_filter to include the content, custom filter

<?php

function custom_filter(){ } add_filter('the_content','custom_filter'); ?>