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.

I'm working on a settings section for my plugin, and after reading over Wordpress's documentation which is in ROGUH DRAFT status, and also the Creating Options Pages - which is also in "transition", I've been left with questions about how to correctly use the new Settings API to add an options page for my plugin.

I have around 30 plugins installed and did a search for the keywords register_setting, add_settings_section, & add_settings_field and only found one match as part of Coffee2Code's plugin framework - for which I can't find any documentation anywhere.

Can someone give me a working example, or provide a link to a simple working example, of how I should use the new "Settings API" to create a simple options page for my plugin?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

I wrote a tutorial for Incorporating the Settings API in WordPress Themes.

The only real difference for Plugins is that you'll use add_settings_page() instead of add_theme_page(). The rest should pretty much be the same.

share|improve this answer
    
has a couple typos in some of the code and functions but overall very helpful. thanks! –  cwd Jan 26 '12 at 7:23

There is an other good tutorial at WPTuts+: Using The Settings API.

Part 1 – Create A Theme Options Page

If you create your own themes you will, sooner or later, want to allow your theme users have some control over certain appearance and/or functional elements of your theme. When this time comes you will want to use the powerful WordPress Settings API. With it, your code becomes simpler, more efficient and more secure.

Part 2: Create A Top Level Admin Menu

This is Part Two of “Create Theme Settings Pages that use the Settings API” tutorial. In this part, we will be looking into how we can create a top level admin menu with more than one settings pages as well as how we can add tabs when we need them. If you have not yet had the chance to read Part One, you may want to do that first before you continue. This tutorial builds on the code shown in the first part of this tutorial.

share|improve this answer

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.