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 trial

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'); ?>