Tagged Questions

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
1answer
175 views

Is it safe to post form data via Ajax to the settings api? Am I missing something?

In my Wordpress Admin, I have my theme options set-up using the Settings API. I am trying to save the theme options form using Ajax so that the page does not refresh. The only thing i needed to add ...
2
votes
0answers
298 views

Settings API store serialized data in the database (The Right Way)

Im trying to learn Settings API and I'd appreciate if someone could clarify this for me. I want to store serialized data in the database. Im using a class to do all the work for me. Heres what I ...
0
votes
1answer
59 views

Can I use add_option for a plugin categories and how?

So I am creating my first plugin for positioning ads around my site. I created one separate table where I store ads with all their options, such as position, expire date, active, name, type etc... But ...
0
votes
2answers
558 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 ...
2
votes
1answer
219 views

Add Admin Menu Inside Construct or Init

I thought I was making headway in my WordPress Development education until I ran across the Boilerplate for WordPress plugins and it uses a class object. I'm fine with that and understand those ...
0
votes
2answers
376 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 ...
2
votes
1answer
999 views

Save and retrieve custom plugin options value

I want to save the value of input data and retrieve it, I have gone through the tutorial of otto press. I'm new to creating WordPress plugin and what I can't understand is once I click the Save ...
1
vote
1answer
286 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', ...
0
votes
1answer
36 views

How to add options for Pages?

I would like to show an input field on the bottom, everytime, when a user create a new page. How is it possible?
-1
votes
1answer
40 views

illegal offset in option add

I downloaded a plugin to dissect that I could use to learn the settings api with. It's a simple background uploader and as you can see fairly straight forward. When trying to recreate it however using ...
0
votes
1answer
377 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
108 views

options validator input is false?

I have a form that looks as such: <form action="options.php" method="post"> <ul class="nav nav-tabs"> <li> <a href="#content" data-toggle="tab">content</a> ...
0
votes
1answer
3k views

Get URL Parameters from referer

Not 100% sure if this one classes as a php question or is specifically Wordpress... I'm implementing the Wordpress Settings API with a tabbed settings page. I've added a 'reset tab' button, but since ...
2
votes
0answers
75 views

Tab from Settings API resetting all options with INSERT INTO [closed]

I have an Options menu created with the code from Chip Bennett tutorial, the old code, though, the one from like a year ago (the new one has a much better validation structure, but still, it works ...
0
votes
1answer
122 views

How to remove a settings section from the Theme Customization API preview pane?

I am currently working on a theme that uses the Wordpress Customization API and I need to remove some pre-existing sections from the customization preview pane. Is there somewhere like a global ...
0
votes
1answer
70 views

How to prevent options.php deleting valid existing data from the database

I am setting up a plugin and have used the setting API for the first time to create a form in settings. The data for the plugin is initially created by default when the plugin is activated and stored ...
2
votes
1answer
318 views

Can I dynamically create duplicate fields with the Settings API?

I'm not sure that my title accurately explains what I'm trying to do, but it's the best way I could think of to explain what I'm attempting to do. I'm writing my first Wordpress plugin, and while ...
0
votes
1answer
226 views

Difference between Option_Group and Option_Name in Register_Settings

I think the title pretty much says it all! I'm working my way through various tutorials on how to add an options page to my test plugin and am struggling to understand the Register_Settings function. ...
3
votes
1answer
2k views

Trigger custom action when setting button pressed

This is my first wordpress plugin and I'm running a lot of trouble making it work, it almost work fine but I don't find a way to accomplish this specific thing. Basically I've my custom setting page ...
3
votes
1answer
529 views

Using tabs for wordpress plugin

Done my research and found this is how to call the built-in ui tabs jquery script in wp for the admin area but I'm stuck on implementing the other jquery scripts needed that I believe are built into ...
0
votes
4answers
709 views

Can't get plugin settings page to save data

have a simple plugin that inserts text (a Google ad) partway through the content of a single post. I'm trying to create a settings page that will let users change the ad code, and change after which ...
1
vote
2answers
186 views

Import / Export Settings API fields values?

I've been storing all my theme options using Settings API for some time now and it's lacking one functionality. I have multiple pages (different servers) using my custom themes and I would love to ...
1
vote
2answers
119 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, ...
0
votes
1answer
1k views

How to use checked() function with multiple check box group? How to properly sanitize that checkbox group?

I'm using the theme options page from the underscores (_s) theme to build a theme options page and I have a group of check boxes on it. In the example below I've just included 2 for simplicity. My ...
1
vote
2answers
500 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 ...
2
votes
2answers
116 views

How to display some settings for super admin user only using Settings API

I'm developing a plugin with an options page using the Settings API. I'd like to have one options array stored for my plugin, but on the settings page, I'd only like some of the settings to be ...
0
votes
1answer
238 views

How to add a Reset to Defaults button with Settings API?

How can I add a reset button when using the Settings API? I've have something like this that's storing my defaults: $slider_options = get_option( 'nextslider_options' ); /* Define the array of ...
1
vote
0answers
103 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 ...
3
votes
1answer
92 views

How to Save Different Settings Options Using Settings API and/or the Theme Optimizer

I would like to allow users to save different versions in the options panel using the Settings API and/or the Theme Optimzer. For instance, imagine that I have styled my site using via an admin panel ...
0
votes
1answer
67 views

How would you accomplish the following advanced settings page?

Currently I'm developing a new theme for my business. This theme will have a header section with a drop down menu, a slideshow on the background and three featured images with a title, a description ...
4
votes
1answer
1k views

Settings API in Multisite - Missing update message

When I use the settings API in a multisite installation and the options page sits at the network level, posting the options to options.php does not work, because the administration page sits at ...
6
votes
2answers
759 views

How do I add settings to the Background Options Page?

I am developing a theme and I wanted to add some extra content to the built in background options page. I know how to use the settings API to create new theme options and settings but I can't seem to ...
1
vote
1answer
684 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 ...
0
votes
2answers
786 views

Verify Submitted Form Values and Show Warning Messages with Setting API

I'm making a plugin administration page with the settings API. I'd like to know a way to display a warning message when the user submits an invalid value. For example, with the below code, if the ...
0
votes
1answer
193 views

Adding Form Fields with Settings API

I'm making a plugin with an administration page witch uses the Settings API. I could make one section and one option. But how can I add other form fields to it? If I add an input tag to the callback ...
0
votes
2answers
425 views

settings api store multiple array

If I am not mistaken, the settings api only storing one single data array in wp_options table. You can only change the field data in the array. What if I want to add multiple array in the same table ...
2
votes
1answer
513 views

How to use the settings API to set multidimensional arrays

I'm writing a course information plugin. Most course info is related to to a post (a custom post type of 'course'), so I have put the majority of info in the postmeta table. But some info isn't ...
3
votes
1answer
949 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 ...
1
vote
1answer
540 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', ...
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
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 ...
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 ...
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
votes
1answer
413 views

Creating your own options-general.php page

I wanted to develop a duplicate General Settings Page instead of the built in one and all the settings on the built-in General Settings Page will also be displayed on the new General Settings Page.. ...
1
vote
1answer
178 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 ...
0
votes
1answer
607 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 ...
2
votes
1answer
110 views

Persist fields with Setting API

In my admin panel, if I use a sanitizing callback register_setting() and the field does not pass through my custom validation, I've been preventing the database from updating by using return FALSE; ...
4
votes
1answer
1k views

wp_editor() fields on Theme Options Page not saving

(This is sort of a follow-up to this question.) I'm able to display the two WYSIWYG editors on my theme options page, but the values I enter into the editors aren't saved. I've read a ton of stuff ...
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 ...