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

3
votes
1answer
952 views

Default Wordpress settings API data sanitization

It looks to me that when saving data to the database via the settings API Wordpress sanitizes data by default. By that I mean that if I look at the raw settings options in the database they have (at ...
0
votes
1answer
315 views

Combo/Drop down box on plugin settings page that allows additional options to be added

I'm not sure what this is called and have not had much success searching for it yet. In a plugin settings page, I would like a 'combo box' or 'drop down box' that also includes the ability to add an ...
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', ...
0
votes
2answers
246 views

[Multisite]How can I update custom blog option?

I wanted to update custom blog option created thru Settings Api using the function update_blog_option. I created this code. $country_base = get_blog_option($blog_id, 'mytheme_options');//retrieve ...
1
vote
2answers
1k views

Validate an option array

We use the default WordPress register_setting() function to validate theme options. This call, for example: register_setting( 'options-group', 'option1', 'intval' ); Will validate whether or not ...
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
99 views

Storage of array in settings

I'm creating a plugin that will store some simple layouts to be used in shortcodes. The shortcode usage will be similar to [shortcode layout="name"] With this mind I'll need to store each layout in ...
1
vote
1answer
515 views

How to save array of datas in option page by setting api?

I am trying to create my own first plugin but I am coding novice so please guide me to the right direction. This plugin is to set the post expiry date based on the user's role. Now I am stuck at ...
0
votes
1answer
608 views

Get categories names as an array to use it in theme settings

I am building a theme and for the Theme Settings Page I followed this tutorial: http://wp.tutsplus.com/tutorials/using-the-settings-api-part-1-create-a-theme-options-page/ What I want now is to have ...
5
votes
2answers
1k views

Settings API - sanitizing urls, email addresses and text

I am asking for advice on best practices on how to write this code. Currently I have simple theme options with text fields, outputting the info in my template. I am currently using this code for the ...
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
731 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
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
378 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 ...
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: ...
0
votes
1answer
325 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 ...
-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
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
vote
2answers
813 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 ...
-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 ...
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 ...
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 ...
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
481 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 ...