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

Andrew Folts
Andrew Folts
14,238 Points

Treehouse keeps telling me I'm wrong... but I won't give up

Not sure what I'm doing wrong...

Here's the question: Create an empty function named my_plugin_styles and then use the information in the comment to enqueue the admin stylesheet. Here's my answer:

function rick_roll() {

echo 'Never gonna give you up';

echo 'Never gonna let you down';

echo 'Never gonna run around and desert you';

}

add_action('admin_head', 'rick_roll');

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Andrew,

The answer very much lies in the question. The code challenge, as I assume this is a code challenge, is asking for a function with a specific name, my_plugin_styles

<?php
function my_plugin_styles() {

echo 'Never gonna give you up';

echo 'Never gonna let you down';

echo 'Never gonna run around and desert you';

}

add_action('admin_head', 'my_plugin_styles');

?>

I can only assume other things like what will be in the function and the hook you're using. It's been a while since I looked as a WordPress hook but I think admin_head is correct :)