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

help

Write an empty function named custom_action(). Then hook your function to the "customize_register" action.

http://teamtreehouse.com/library/actions-code-challenge

my code:

<?php function custom_action( ) { } add_action('customize_register'); ?>

4 Answers

Brad Van Skyhawk
Brad Van Skyhawk
28,489 Points

I forgot the second parameter, which is the function name.

add_action('customize_register', 'custom_action');

<?php function custom_action() { add_action('customize_register', 'custom_action'); } add_action('customize_register', 'custom_action');

?>

Here's what I have function custom_action() { add_action( 'customize_register', 'custom_action' ); }

And it still tells me I'm wrong, that I need to call add_action. What am I doing wrong?

This is the right code:

Line 2 function custom_action( ) { } Line 3 add_action('customize_register', 'custom_action');