Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

If I set up a theme options page in the way suggested by the codex (http://codex.wordpress.org/Creating_Options_Pages) then my form submits to 'option.php'.

settings_fields creates a nonce, which if I was creating my own submission page would be checked with check_admin_referer.

My question then.... if I use options.php as my 'form processor' does this mean I cannot use check_admin_referer?

Thanks, Nick

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

You do not need to use check_admin_referer. If you are using the Settings API then WordPress handles nonce checking and saving data to the database.

In terms of data validation, the only thing you need to provide is a validation callback. This callback receives all inputs with name specified in the second argument of register_setting (I often use this name to store an array of all my plugin option - so I only register one setting). The callback is specified in the third argument of register_setting and is responsible for returning the validated setting(s).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.