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

0
votes
1answer
162 views

Wordpress settings API VS Table In Database?

I have created an options page for my plugin using Settings API. Now I want to create another tab where user will create records. He will also like to delete/edit records. There will be 10-20 records ...
0
votes
1answer
1k views

How to create a Wordpress options page

I've followed this guide precisely: http://codex.wordpress.org/Creating_Options_Pages However when I do do_settings_fields, it says: Missing argument 2 for do_settings_fields() Even though it says to ...
4
votes
1answer
287 views

How do I flush the rules after saving settings using the Settings API?

I'm using the Settings API to allow the user to toggle the has_archive option on some custom post types. When the user turns archives on or off, I want to flush the rewrite rules. If I had written ...
0
votes
1answer
92 views

settings api and the data passed in the parameter

in an example of the Settings API, there's an input and the callback function to sanitize/validate the result from this input : this is the input : echo "<input id='text_string' ...
3
votes
1answer
732 views

Settings API - save an array of options as one setting (array_push?)

1. Basic settings API callback. Using Settings API my $sanitize_callback validating function looks like: (...) if($type == "foo") { $valid_input[$id] = $option[$id]; } else ...
0
votes
1answer
303 views

Tabbed theme options query about add_settings_section callback function

I have been building a tabbed option page based on some tutorials I found, using the settings API. Here is the code http://pastebin.com/bbSnhFP5 . It's all actually working fine for me but it's not ...
0
votes
1answer
292 views

Settings API - getting hidden input / submit button's name

I'm generating this form using Settings API: <form action="options.php" method="post"> <?php settings_fields('XX_theme_settings'); do_settings_sections('my_settings'); ?> ...
0
votes
1answer
592 views

Settings API validation callback

I finally managed to create working validation callback for Settings API with big help of Chip Bennet, there's only one glitch that I'm not sure how to fix. Here's the foreach loop from my validation ...
5
votes
1answer
1k views

Settings API - easiest way of validating checkboxes?

I'm using Settings API and I can't get checkboxes to work, if they're set to "false" they're not even being $_POST and that's the point. Stephen Harris & Chip Bennett explained it, but I believe ...
2
votes
1answer
1k views

wordpress settings API and option array structure

how do you get the settings API to save options that are in an array structure like this: $array = array ( array( 'id'=> '1', 'name'=> 'tom', ...
1
vote
1answer
162 views

Echoing a variable inside a function

In the interest of automation, instead of making a long list of code like this <td valign="top"width="50%"><p><label for="Facebook"><strong>Facebook ...
0
votes
1answer
275 views

Settings API - how to update options manually?

I'm storing all my options using Settings API: function registerSettings() { register_setting('XX_theme_settings', 'XX_theme_settings', 'setting_validate' ); add_settings_section('theme_options', ...
2
votes
3answers
143 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
295 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
1k 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
379 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
327 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
103 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
500 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
166 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
471 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
1k 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
321 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
55 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
307 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
816 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
114 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
612 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
490 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
288 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
128 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
2k 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
908 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
482 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 ...