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

1
vote
2answers
44 views

Settings API in Section

I have a snippet that creates an option in Settings->General using Settings API. However, the values don't get updated and I was wondering if anyone can help point out the problem with the following ...
1
vote
2answers
116 views

How can I insert some extra validation into the theme options' validation function using add_filter?

I'm using the theme options from the underscores (_s) WP theme as a base for my own theme options. If I wanted to insert the validation from the bottom function into the top function's $output array, ...
1
vote
2answers
481 views

wp_update_nav_menu_item not saving in multisite API

I'm creating a script that automates build a wordpress site from another CMS. I've been able to change every setting: themes, options, subdomain, site title, etc. But what is eluding me is being able ...
1
vote
1answer
618 views

Settings API - adding setting fields dynamically?

Is there a way of adding settings fields dynamically? I have my own Settings API options generator just like in Chip Bennet's Oenology Theme, everything works perfect but I can't find a way to create ...
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
172 views

Settings API and dynamically generated submenu pages

I have the following situation - I'm making a WordPress version of a jQuery plugin and I want the users to be able to have multiple instances of the plugin (with unique content) for their site. On the ...
1
vote
1answer
356 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
763 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
vote
1answer
855 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
37 views

Where to hook settings api init

I am getting a bunch of notices in Theme-Checker for my settings api init function. The notices are all for 'undefined index' in the $_REQUEST array. Here is the code : <?php function ...
1
vote
1answer
1k views

WordPress Settings API, Implementing Tabs On Custom Menu Page

I've been following the WordPress Settings API tutorial series of this guy: http://wp.tutsplus.com/tutorials/theme-development/the-complete-guide-to-the-wordpress-settings-api-part-1/ So far, I've ...
1
vote
1answer
249 views

How to validate register settings array

I would like to know how to perform a proper validation with the register_setting() callback function. Here is a sample part of my code I want to work with: register_setting( 'wpPart_options', ...
1
vote
1answer
500 views

settings API: how to create a multi checkbox with blog categories?

i need to create a callback function with a multi checkbox with all the web/blog categories as multi options. my add_settings_fields are: add_settings_field( 'select_page', ...
1
vote
1answer
461 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 ...
1
vote
1answer
161 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 ...
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
vote
2answers
296 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
0answers
22 views

Determining the compatibility of Settings API & Multisite

New to this forum so forgive any protocol infringements on my part and feel free to criticize so in the future I don't again. Down to the nitty gritty. I'm working on a project and am very new to ...
1
vote
1answer
137 views

Saving Plugin settings to the database

I'm not a complete novice with php or wordpress but am wanting to approach this problem the most efficient way so believe asking here will help. I've got a plugin that randomly generates a quote - ...
1
vote
0answers
216 views

Bulk update all posts from plugin settings screen

I'm writing a plugin right now that will populate custom metadata for all posts on the site based on a certain rule. I've already created a Plugin's settings page and a logic that should be triggered ...
1
vote
1answer
95 views

Settings API repeater fields

I'm new to the WP settings API, and a fairly novice PHP developer. To get started I followed this great tutorial Using Settings API - part 1 — Create a Theme Options Page and customized it ...
1
vote
1answer
131 views

Getting error to display radio button value in General Settings page

I'm constantly getting the errors bellow when printing the radio button values from General Settings screen: Illegal string offset 'service' in ...
1
vote
1answer
77 views

Can I use the different settings sections over different pages using the save options group?

I registered one options group with few different options sections. Each section is meant for different page. register_setting( // ...
1
vote
0answers
368 views

How can I save a multiple select array with the settings API for a plug-in options page?

I'm thinking this may be more of a problem with my PHP rather than my use of the settings API, but I can't seem to get Wordpress to save an array of data for a multi-select box. The multi-select box ...
1
vote
0answers
375 views

Using multiple settings_fields() on 1 settings page

I have been struggling with this one for about a week now. I would like to have 2 variables available on a settings page, but I cannot figure out how to do this using the Settings API. Perhaps there ...
1
vote
3answers
470 views

Alow users to delete uploaded images inside backend?

I am allowing user's to upload their images, so to show their uploaded images i am using<?php echo $options_images['image_bg'];?> which outputs ...
1
vote
0answers
114 views

Letting user dynamically create fields using Settings API

I created a settings page, using the Settings API, following this tutorial. Now I want to have a button that lets users dynamically add fields, similar to the way it is done in this other one. I ...
1
vote
0answers
98 views

Using Singleton in wordpress themes/plugins [closed]

i am creating a wrapper class for wordpress settings API to generate theme options page. i used singleton design pattern to avoid multiple instance. is it the right place to use the pattern ? because ...
0
votes
1answer
266 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
355 views

Settings API - save multiple tabs at once

In the attached screenshot you can see the structure of the theme options we are working with. There are 8 tabs and for each tab, we have created custom fields using code similar to what can be seen ...
0
votes
1answer
268 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
264 views

Run function AFTER theme options are saved?

Weird question, how can I run a custom function AFTER my theme settings are saved? I see that the register_settings() function has a sanitize callback, but that runs before the settings are changed. I ...
0
votes
1answer
559 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 ...
0
votes
2answers
98 views

Issue on Checkbox with Custom Option Page

I am trying to use a checkbox on Custom Option page by using Setting API. Every thing works fine at back-end and I can update the checkbox states by registering the settings.But when I would like to ...
0
votes
1answer
121 views

Consequences if using PHP include TEMPLATEPATH?

I have created a Theme Options page using Settings API so now I need to style it using CSS. Instead using function like this inside functions.php function mytheme_add_init() { if ( is_admin() ) { ...
0
votes
2answers
506 views

Color Options from Theme Customizer API not returning via get_theme_mod()

I am working with the Theme Customizer API and am going crazy trying to find the stored values. The values successfully save and update on the front-end, so they are obviously registered ...
0
votes
1answer
315 views

Settings API enable default settings on theme install?

I am still learning settings API so please forgive my noob question. I have three fields: a checkbox, colorpicker and text field (they are working), but I would like to do this: when the theme is ...
0
votes
1answer
554 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 ...
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 ...
0
votes
1answer
962 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 ...
0
votes
1answer
29 views

Setting conditional background image from meta value

I am trying to set background image from meta value.I am successful also.But if the meta image is not set the out put <div id="pricing" style="background: url('')"></div> But I do not ...
0
votes
1answer
45 views

Theme settings Page: Settings Api vs Update_Options

I’m a new WordPress developer trying to start a carrier selling Premium Themes. In the last week, I’ve been confronted to many difficulties trying to understand how to create a theme options page. At ...
0
votes
2answers
110 views

Can't output do_settings_sections . Can't understand why

I've this code: /* Hook to admin_menu the yasr_add_pages function above */ add_action('admin_menu', 'yasr_add_pages'); function yasr_add_pages() { //Add Settings Page add_options_page( ...
0
votes
1answer
52 views

Why won't register_setting() create a setting?

I'm stumped. I've been researching this like crazy, but I can't seem to figure out why register_setting() isn't working for me. I'm new to WP plugin development (obviously), so it's probably just ...
0
votes
1answer
10 views

Use the Settings API to whitelist a setting, but don't output it

I have a plugin page with several settings. Four of this settings, all in the same section, need to be displayed inline rather than one above the other. However to ensure the settings are whitelisted, ...
0
votes
1answer
25 views

How to use/retrieve an options array, with defaults, using get_option()

Someone explained me that using get_option is not productive, it's better to implement a custom function and then save the options in a single multidimensional array. Before I thought that having an ...
0
votes
1answer
29 views

Secure my “add_settings_field” translation?

I am using "add_settings_field" and want to provide translation for it , but my problem is security. So is __('My Checbox:' , 'domain') secure enough for translation? If not what can I do about it? I ...
0
votes
1answer
42 views

Settings API settings section not appearing

Settings API always been a little confusing for me. I am trying to add a simple theme options page for a child theme I am developing. I guess I am doing something wrong that preventing the section ...
0
votes
1answer
86 views

How to retrieve the options from this options page?

I like to write a plugin with an options-page from the WordPress-Codex, but I cannot retrieve the options. get_option('your_option'); does not work. Here is the options page code: <?php class ...
0
votes
1answer
24 views

How do I display a WP Option from an array?

I have a problem displaying the data that I am successfully saving to my database. function create_input_twitter_option() { $options = get_option('global_options_arraykey'); ?><input ...