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

Christian Kristoffersen
Christian Kristoffersen
32,531 Points

Problems with code challenge 1 in Creating a Plugin Settings Page

I have a bit of trouble with this code challenge :) Is there anyone that could maybe take a look at it :) This is what i've done, but it's not right

<?php

function my_plugin_menu() {

  add_options_page (

    'My Plugin Settings Page'
    'My Plugin'
    'My Plugin'
    'manage_options'
    'my_plugin_options_page'

  );

}

add_action( 'admin_menu', 'my_plugin_menu' );

?> 

2 Answers

Aaron Jackson
Aaron Jackson
5,644 Points
<?php

function my_plugin_menu() {

    add_options_page ( 
    'My Plugin Settings Page',
    'My Plugin',
    'manage_options',
    'my-plugin',
    'my_plugin_options_page'
  );

} 
   add_action('admin_menu' , 'my_plugin_menu' );


?>

Your could should look like that to get pass the first challenge

Christian Kristoffersen
Christian Kristoffersen
32,531 Points

Arrh, thank you very much Aaron! This really helped!

Aaron Jackson
Aaron Jackson
5,644 Points

No problem glad to help!