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 trialLyric Abbott
35,595 Pointshelp
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
28,489 PointsI forgot the second parameter, which is the function name.
add_action('customize_register', 'custom_action');
Annie Scott
27,613 Points<?php function custom_action() { add_action('customize_register', 'custom_action'); } add_action('customize_register', 'custom_action');
?>
Renee Wilson
9,820 PointsHere'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?
edvincalderon
Courses Plus Student 2,896 PointsThis is the right code:
Line 2 function custom_action( ) { } Line 3 add_action('customize_register', 'custom_action');