0
votes
1answer
37 views

Settings api sanatize callback not being triggered

I'm creating a custom settings page for a custom theme however the callbacks for sanatizing the data in the fields are not being called (I put in xdebug breakpoints in them to check). /** ...
1
vote
1answer
185 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
59 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 ...
0
votes
2answers
543 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 ...
1
vote
2answers
731 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
101 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; ...
0
votes
1answer
212 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
471 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 ...
4
votes
3answers
1k 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 ...