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

14
votes
1answer
4k views

Settings API with arrays example

I'm using the Wrox WordPress plugin development book as a primary reference for getting started with a new plugin and I understand all settings can be saved as 1 array but the book does't give an ...
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
2k 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 ...
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 ...
2
votes
1answer
224 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 ...
1
vote
2answers
896 views

Is get_option function cached?

In my plugin, I use the following code to retrieve an option from the database: $options = get_option('my_plugin_options'); If I use this 10 times in various functions of my plugin, does WordPress ...
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 ...
4
votes
1answer
2k 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 ...
1
vote
2answers
190 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
1answer
297 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 ...
1
vote
1answer
921 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 ...
0
votes
1answer
403 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 ...
2
votes
1answer
712 views

“Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin

I am developing a plugin using Tom McFarlin's Boilerplate repository as a template, which utilizes OOP practices. I've been trying to figure out exactly why I'm unable to correctly submit my settings. ...
2
votes
1answer
519 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 ...
1
vote
1answer
217 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
1answer
183 views

Settings API - how to update multiple 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', ...
1
vote
1answer
2k views

How to Use Checkbox in Custom Option Page Using The Setting API

Can you please let me know how I can add a checkbox to Setting API in creating Custom Options Page? I am using the following code to add a txt box which is working perfectly but I am totally confused ...
1
vote
2answers
829 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 ...
0
votes
2answers
203 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
62 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
0answers
76 views

File input returns null in theme options array

Trying to work out a rather complex array situation with a theme options page. While working with file upload I can't seem to get it to work. Any idea what I might be missing? Simplified example ...
0
votes
2answers
430 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 ...
0
votes
1answer
299 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
284 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', ...