The Settings API, added in WordPress 2.7, allows admin pages containing settings forms to be managed semi-automatically. It lets you define settings pages, sections within those pages and fields within the sections. New settings pages can be registered along with sections and fields inside them. ...

learn more… | top users | synonyms

2
votes
3answers
137 views

Echo all API Settings sections?

Is there a WordPress function displaying all sections registered with add_settings_section()? I was thinking about SQL query maybe, but have absolutely no idea how and where these are stored, ...
1
vote
1answer
288 views

Settings API erases itself?

I have two forms created using Settings API, and when I save one of them the other one gets erased and vice versa. Here's the whole code so you could paste it into your functions.php file and see ...
5
votes
1answer
908 views

Settings API - creating reusable form elements?

I have a set of settings fields: (...) add_settings_field( 'Option1', 'Option 1', 'textarea', 'page1', 'plugin_options'); add_settings_field( 'Option2', 'Option 2', 'textarea', 'page1', ...
1
vote
1answer
355 views

Settings API - changing add_settings_field() output?

I'm using Settings API and wondering if there's any way of editing default output of add_settings_field() function? add_settings_field('the_field', 'bar', 'foo', 'page', 'section'); function ...
2
votes
2answers
2k views

How should I use register_setting, add_settings_section, & add_settings_field in my plugin's options page?

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", ...
0
votes
1answer
317 views

Options don't save, validation callback not executed

I have been using settings API for my plugins for some time and it used to work well. Now it is broken and I can not figure out why. Apparently, the option validation function is not even called. Form ...
3
votes
2answers
101 views

Which to use to execute code during the saving of a plugin settings page?

I'm writing a plugin with a settings/option page and I want some php code to be executed whenever someone saves the settings on that page and that page alone. Which actions do I need to hook into to ...
1
vote
2answers
493 views

Wordpress Settings API: saving multiple rows of similar data

I've been experimenting with the plugin options starter kit but can't find a way to save multiple rows of similar data using the Settings API. Example of what I'm trying to save: ...
-1
votes
1answer
154 views

How can I include a setting that has a variable number of values in a settings page using register_setting?

I have one option on a settings page that can have between 1 and 5 values. I have a basic understanding on how to set up single value settings using the Settings API, but how do I go about generating ...
0
votes
2answers
403 views

Displaying errors with settings api

I'm not using the full settings api, just this code: register_setting( 'my_options', 'my_options', 'my_options_validate' ); Then my validation: $options = get_option('my_options'); ...
0
votes
1answer
956 views

Change the display of Settings API (do_settings_sections)

I am working on a plugin which uses Wordpress Settings API. I notice that the functions do_settings_sections (and do_settings_fields) display the fields using TABLE. How do I change its formatting? (I ...
-1
votes
1answer
289 views

How to delete all the options in an option group

I have created a few options with with the register_setting function: <?php register_setting( $option_group, $option_name, $sanitize_callback ); ?> Is there a way to clear the whole content ...
0
votes
1answer
54 views

Pause plugin option page until all data manipulation is complete

I have an option on my plugin page where I load content into all the posts in the blog. Now this takes some time, esp when there are a log of posts. Now the way is it set up now, when you press ...
1
vote
2answers
295 views

Possible to add another setting to 'Front page displays' setting for Custom Post Type

Let me set the scene: I have a CPT that will work on a multi-site installation and some of the sites will be in a different language. For example my CPT is Case Studies I would use a URL structure ...
1
vote
2answers
758 views

wordpress settings api add fields

I am trying to add some code to a theme that will allow the user to change the logo or have some text instead. I managed to find some code that otto posted to do the file upload. I have added what I ...
2
votes
1answer
112 views

Adding labels to Setting titles with API

If I add a setting using add_settings_field(), it doesn't create a <label> around the title so that it can be clicked to focus on the field. Some of the core settings do this, but they just add ...
8
votes
3answers
591 views

What are the advantages to the Settings API?

Let me preface this by saying that I hardly ever work with WordPress - in fact, the last time I did a site in WordPress was back during 2.2. Yesterday I made quite a mess of everything and asked ...
4
votes
3answers
480 views

What's the best method for emptying an option created with the Settings API?

I'm trying to empty an option created with the Settings API and failing. update_option ( 'my_option', '' ); appears to do nothing, whereas delete_option ( 'my_option' ); destroys the whole option ...
1
vote
3answers
282 views

Using the Settings API, how should I add multiple values to an option?

I'm trying to add/ update additional values to an option created with the Settings API. I'm trying to do this with my validation callback function, but I'm not getting very far. Here is my code: ...
0
votes
1answer
126 views

Why isn't the Settings API designed to work for plugins using custom admin menus? [duplicate]

Possible Duplicate: How should one implement add_settings_error on custom menu pages? The Settings API offers all sorts of labour saving features and future proof code. I find it really odd ...
6
votes
3answers
1k views

How should one implement add_settings_error on custom menu pages?

The Professional WordPress Plugin Development book explains in detail how to properly use the Settings API, and it also demonstrates how to add Menus and Submenus, but unfortunately it doesn't provide ...
1
vote
1answer
853 views

Plugin settings not saving

I'm having a devil of a time getting my plugin settings to save. I've gone through the code so many times I have to think I've simply missed something. I'm following the Setting API, but any changes ...
1
vote
1answer
464 views

GET parameters interfere with my plugin settings

I have my plugin all set-up using the Settings API and working but what I have is two manual functions in my plugin that can be run by the admin user by visiting the following URL's <?php echo ...
11
votes
2answers
2k views

How to pass variable to add_settings_section() callback?

I am attempting to automate, as much as possible, the Settings API function calls for each setting in a Plugin. Looping through the options array, and outputting add_settings_section() and ...