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 Building a WordPress Plugin Settings Page Admin Area Forms in WordPress

Write a conditional statement to see if the input field has been submitted.

I don't recall the previous video going over this at all.

plugin.php
<?php

function my_plugin_options_page() {

    if (!current_user_can('manage_options')) {
        wp_die('You do not have sufficient permissions to access this page.');
    }



}

?>
Konrad Pilch
Konrad Pilch
2,435 Points

My advice is to watch the whole series or track and then comeback to it , re-wathing it, or just re-doing the challenge. Things get easier the second time.

3 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

Hi Sarah Augustine,

The training for this portion of the challenge can be found in preceding video, Working with Forms in a WordPress Plugin Settings Page.

The answer can be found beginning at 3:30 of the video, although with a different variable name. However, the concept is the same and I recommend watching the entire video again if you need to.

We will need to create a conditional statement using isset and$_POST while using the Challenge's variable name as the $_POST parameter.

As an aside, sometimes I have to re-watch videos more than once to finish a Challenge or let a concept sink in well enough for me to understand it and then use it. I download all the course videos because I find myself going back to them sometimes when working on my own projects or for a refresher. it's not a bad thing as we all learn at different paces and accumulate knowledge and skills at varied rates.

Best of luck and happy coding. :)

Is there a button for 'not helpful' advice?

Konrad Pilch
Konrad Pilch
2,435 Points

Well, if you are going to watch the entire track or section, then you will get more familiar with it all. Since you will get familiar with it, you can re-watch it or comeback to it and you will be able to do it. I did that, others did that.

Just opinion. Since no one is answering this, i gave you a possibile thing you could do that i did and it worked. But everyone thinks of advice, differently, same as people view friendship differently :)

As a teacher, I know better than to teach a language and pattern by one name, then send my students to repeat the pattern giving the pattern a different name. That's not good teaching. That, at best, is poor editing.