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
0answers
18 views

How can i save multiple recodes dynamically using WordPress Settings API

I search a lot here at Stack Exchange and on web but i did not find any help. I know how to use WordPress Settings API to save a single field, i want to save multiple records dynamically, it may be ...
0
votes
1answer
25 views

How to add a secondary button to a settings page with a custom action?

I have written a plugin that interfaces with a third-party mailing API. I have created a settings page for my plugin that includes two buttons: a submit button created with submit_button() which ...
1
vote
0answers
40 views

Allow users to add / remove settings in plugin

I have created a plugin for a client of mine that I think could help a lot of people out there, so I'm in the process of "generalizing" it. Right now, I'm using the Settings API and textareas in ...
0
votes
0answers
16 views

register_setting sanitize callback $input is null

I am struggling to get my settings page to save my options. I've got it showing up correctly and it hits the sanitize function register_setting( 'my_options', // Option group '...
1
vote
1answer
15 views

null callback in add_settings_section

Some code I'm looking at from a Plugin contains this line add_settings_section("section", "Settings", null, "theme-options"); which has a null callback. Having looked at https://codex.wordpress....
0
votes
0answers
19 views

Correct way check nonce (security) using old Options API

I am developing plugin for Wordpress. Firstly I started using Settings API it looks good, but it is little bit complex and it doesn't provide the way to handle options manually. I have quite ...
0
votes
1answer
511 views

get_option() returning empty

I'm building a settings page for a theme and the get_option() that I'm using to retrieve the settings returns only string(0) "" even though there is a checkbox field. What I want is to retrieve the ...
6
votes
3answers
204 views

Where to store plugin settings fields

I am developing plugin right now, and I have one questions about best practices and conventions. What I need ? My plugin is going to store some predefined object, list of objects (or just ...
1
vote
2answers
47 views

Update problem with update_option() in combination with register_setting()

Intro I have a settings page which includes a setting with a more complicated callback function to save. Save data To save the data I use the register_setting() function with a custom sanitize ...
0
votes
1answer
465 views

Setting the uploads directory

So I want to change my uploads directory. I'm able to change it using: add_filter( 'pre_option_upload_url_path', 'wpse_77960_upload_url' ); function wpse_77960_upload_url() { return 'http://...
0
votes
0answers
30 views

Is It Possible to Use the Wordpress Settings API Without Having the Settings put into a Table Tag?

It seems that when using the Wordpress Settings API that all settings are placed inside a table with a class=form-table. Is it possible to override that? That is to say, to simply have the settings ...
-1
votes
1answer
26 views

Where to adjust presets for slider options “auto rotate” (3, 5, 10, 15 seconds)? [closed]

I’m currently helping somebody out with their wp installation – and we’re a bit puzzled with the presets for a slider / corousel. The theme in use Stockholm, featuring the Visual Composer plugin. In ...
3
votes
1answer
34 views

How do I save custom options on the options page 'Reading'?

I want to add some options to the default "Reading" options page. The code I have is: add_settings_section("section_share", __("Sharing & Publishing", "honeycomb-wp"), __NAMESPACE__."\\...
0
votes
0answers
15 views

plugin settings - multiple upload buttons in sections: how does sanitize_callback work?

my plugin' settings page includes a series of sections, each one contains an upload button: // create the input with the *exact* setting's name function myplugin_upload_cb($args) { echo "<input ...
0
votes
1answer
1k views

Uploading files using the Settings API

I've used the Settings API in the past to output text inputs and checkboxes but am unsure if I can use file inputs. My add_settings_field() is: add_settings_field( '1', 'File 1', array( $this, '...
0
votes
0answers
13 views

How to do multiple fields under single settings field using Settings API? [duplicate]

This image is taken from WooCommerce. I've seen their code, they have their own API for settings fields. I want to stick with the WordPress' Settings API. But I liked their concepts of having multiple ...
3
votes
1answer
28 views

When should I call add_settings_section and add_settings_field?

All of the examples I've seen for add_settings_section & add_settings_field have them being called on the admin_init action. This means that they're being called when loading every single admin ...
0
votes
1answer
44 views

Wordpress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options

How do I modify the Settings > Permalinks (options-permalink.php) admin page to add more custom permalink parameters? I'd like to add additional permalink parameters to the "Optional" section for ...
0
votes
0answers
22 views

Multiple checkboxes sanitization using the WordPress Settings API

Dear All I have a problem in sanitizing a value for a group of checkboxes, using the Settings API. I am using the following - just for demonstration purposes: add_settings_field( '...
0
votes
0answers
28 views

Upload file via settings page

Question: Is there a secure way to upload files via a plugin settings page? Context: Hello world! A feature of my plugin requires the user to upload one or more files. More precisely, JSON files ...
0
votes
1answer
84 views

custom wp_editor does not save the content in plugin settings

I am creating a custom settings page for my plugin. I have four textarea fields, Which need to be replaced by wp_editor. My problem is that I am not able to store the data to database. Bellow is my ...
0
votes
1answer
27 views

WP Page Options Array

I'm creating a page options which contain some multiple checkboxes with specific values. Here is a snippet of my checkboxes form code: <label>Global Checkboxes</label> <input ...
0
votes
1answer
23 views

How to add settings subpage from a plugin to a settings page created in theme?

I'm using add_menu_page(...) from a custom theme and I want to add subpages to that menu with add_submenu_page(...) . If I try to do it from the theme it works as expected but when I try the same from ...
3
votes
1answer
25 views

do_settings_sections() doesn't escape quotes

I'm using the Settings API on a custom settings page: <form action='options.php' method='post'> <?php settings_fields('myplugin_settingsPage'); do_settings_sections('...
0
votes
1answer
98 views

What exactly is the purpose of settings_fields()?

In the API description for settings_fields() it reads: Output nonce, action, and option_page fields for a settings page. And a look in the includes/plugin.php file turns this up: function ...
0
votes
1answer
146 views

how to get wp_editor to save data in plugin admin page

I'm trying to use plugin settings api to add wp_editor, but the text is not saving. // add the admin settings and such add_action('admin_init', 'my_plugin_admin_init'); function my_plugin_admin_init()...
5
votes
2answers
6k 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 ...
4
votes
1answer
133 views

Flush_rewrite_rules not working when settings updated

I have added some custom options to my WordPress CMS within the Reading admin page. I am using these options to set some additional pages that I then have bound to custom operations. This method ...
0
votes
1answer
183 views

Customizer_register not saving custom setting to database

I'm currently trying to work on a WordPress theme based on Sage. The stage I'm at is creating custom controls to display on the customize screen for WordPress where you typically change things like ...
0
votes
0answers
14 views

Multiple page plugin settings

I am building a plugin and I have made a single setting page that is working without any issue. Since it is becoming very long, and that it is made of 3 distinct sections, I wanted to split it in 3 ...
0
votes
2answers
78 views

Plugin set default setting value when it activated

I have set up my plugin option on admin panel with /** * Register and add settings */ public function page_init() { register_setting( 'my_option_group'...
0
votes
0answers
72 views

Setting API - Default values for options when active the plugin

I have registered two options called test33_header_logo and test33_advertising_code. I need to set default options(test33_header_logo="logo1",test33_advertising_code=123456" when activate the plugin....
0
votes
1answer
22 views

WordPress Setting API - There is no field in options.php

I am creating a small WordPress plugin. I created setting page and there are two user inputs in setting page. I created two option types. Those are rmpm_post_newcount and rmpm_post_newname. After ...
1
vote
1answer
53 views

Settings API - Separating PHP and HTML

I've created a plugin where the settings are configured on different tabs. Each tab saves its settings to a different field in wp_options. The HTML for each tab is separated out into its own file so ...
0
votes
0answers
14 views

update_post() on all databases of a multisite wordpress

I want to change a certain option from every single site of a multisite networks. I wrote the following that I hope will update all databases $allSites = wp_get_sites(); foreach (allSites as ...
0
votes
1answer
15 views

Getting all the settings for a plugin

Looking at the Settings API and you can register new setting using register_setting() but I can't find a way of getting all the settings for a certain plugin. Let's say I want to get a list with all ...
1
vote
1answer
84 views

How to fix Uninitialized string offset: error on a checkbox in WP Settings API

I am trying to create an options page with a checkbox field. The checkbox is working fine but when I uncheck it and save settings, an error string shows on Notice: Uninitialized string offset: 0 in ...
0
votes
0answers
22 views

WordPress Settings API - Create Groups of Settings

I am building a plugin that will utilize the WordPress Settings API for its settings for the first time (I've used option frameworks in the past). I have already created and registered the settings ...
0
votes
4answers
1k 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 ...
0
votes
0answers
12 views

Turn on certain plugin options after plugin install

I'm having issues in finding a way to auto-activate certain plugin settings on plugin activation. So for example , after you install the plugin "Option 1", "Option 2" will be automaticly ON. Here's ...
0
votes
1answer
58 views

Splitting do_settings_sections within HTML?

This seems like it should be very simple to achieve, but I have spent far too long trying to figure it out. I have two settings sections: add_settings_section( 'cp_required_info', 'One', array($this, ...
1
vote
1answer
68 views

Storing HTML in wp_options

I'm giving my users the option to store HTML in an option with a wp_editor(), using the wp settings api to handle the form. I currently do not apply any data sanatization to it, but realize I probably ...
0
votes
2answers
236 views

Allow HTML in Settings API input field

I want to allow HTML into a plugin input field via a user, I am using the Settings API, but it strips everything HTML out. - Code below -any pointers? function plugin_settings(){ register_Setting( ...
0
votes
0answers
47 views

Select fields on a settings page

I'm trying to do it in the style of 'Example #2' on this page: https://codex.wordpress.org/Creating_Options_Pages as it seems the tidiest way I have come across to do it. The problem is I want to ...
0
votes
1answer
54 views

Two settings_fields in one form

I am trying to add my own plugin option to the Easy digital downloads plugin. The sample code is here: http://docs.easydigitaldownloads.com/article/383-automatic-upgrades-for-wordpress-plugins I ...
0
votes
1answer
23 views

Can someone tell me where I've gone wrong with this plugin's Settings page?

I've been trying to learn how to make a plugin in my spare time. I'd previously done all of the coding pertaining to the settings page and it all appeared to work well. Having completed some other ...
0
votes
0answers
51 views

Custom Settings Page not uploading Image

I am creating a custom settings page for a wordpress theme (i.e. a Theme panel). To display all the editable fields I do as follows: Create the Section for the current set of options with ...
1
vote
0answers
37 views

Save & Publish disabled for two dimensional array Customizer

I am developing custom control in customizer. Control Its 4-5 textboxes that I can sort internally. Its a foreach loop. textbox1 textbox2 textbox3 .. The data stored is in array. $theme['textbox'][...
2
votes
0answers
84 views

Cannot update my options using wp_ajax

I have implemented wp_ajax in on my options page but the value of my options are not getting saved or updated. Here is my form: public function email_settings_form(){ // Set class property $...
1
vote
1answer
83 views

Am I using the flush_rewrite_rules function in the right place?

Hello dears I'm writing an admin panel for my new WordPress plugin base on the WordPress Settings APIs. I am defining a field for changing custom post slug from this admin panel. After the custom ...