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 How to Build a WordPress Plugin How WordPress Plugins Work Filters Code Challenge

Why when I type custom_filter(){}; it says "unexpected '}'"?

I think I wrote empty function as it was asked in this task. I can't go further without completing this task. Help please

plugin.php
<?php




?>

2 Answers

Shane Oliver
Shane Oliver
19,977 Points

You need to create a function for your custom filter and add your filter to the_content hook

<?php

function custom_filter( ) { }

add_filter('the_content','custom_filter'); 

?>

I did exact code as you before I answered this question and result was the same: "Unexpected '}'"