The problem is in my file settings.php
(which renders the form). Look at the form action. It says action="options.php"
and then the settings_field()
inserts a hidden field with the correct action. But WordPress prioritizes the form action, so, when submit the form, WordPress tries to load options.php
instead of the correct action in the hidden field.
The solution? Simple:
Replace in the form action="options.php"
by action=""
.
This simple patch fixes the error.
Related Posts:
- How to prevent options.php deleting valid existing data from the database
- Why aren’t these WordPress options being saved to the database correctly?
- Settings API vs Theme Customizer
- Run function AFTER theme options are saved?
- Settings API – sanitizing urls, email addresses and text
- Add your own settings page for plugin
- Adding an html editor to plugin settings page
- add static page to reading settings for custom post type
- How to display an admin notice after updating plugin settings?
- Add settings fields on options discussion admin page
- Validate an option array
- Save and retrieve custom plugin options value
- Dynamic settings fields with Settings API
- Settings API repeater fields
- do_settings_sections() doesn’t escape quotes
- Import / Export Settings API fields values?
- Saving multiple checkboxes with WordPress settings api
- Letting user dynamically create fields using Settings API
- wordpress settings api add fields
- Adding labels to Setting titles with API
- register_setting sanitize callback $input is null
- Can I dynamically create duplicate fields with the Settings API?
- Performance of several get_option() calls
- Settings API – input always updates over validation
- What exactly is the purpose of settings_fields()?
- Persist fields with Setting API
- wordpress settings API and option array structure
- Echo all API Settings sections?
- Settings Page won’t save
- How do I save custom options on the options page ‘Reading’?
- Settings API – generating field value based on a different field?
- Submit options page input values with decimals
- Using multiple settings_fields() on 1 settings page
- Settings API store serialized data in the database (The Right Way)
- Output ‘do_settings_sections()’ as tabs, not one under the other
- Saving plugin’s settings in 1 field in json format
- PHP Notice: Undefined offset: 0 in /wordpress/wp-includes/plugin.php and Register Settings API change
- Hide output of add_settings_field()
- How to make new plugin setting checkbox default as checked
- How to wrap html around Settings API add_settings_section()
- WordPress setting with select – where is my mistake?
- What is the best way to save and retrieve Multiple rows of data with the Settings API?
- Storing HTML in wp_options
- Multiple fields with add_settings_field callback
- Settings API: Two update notices after saving settings?
- Settings API in Section
- Storage of array in settings
- Settings API and dynamically generated submenu pages
- Display Each Setting Section In Each Specific Tab within Same Page || Settings API
- WordPress Settings API – Sanitize Integer
- Preserve old values on error in setting API
- WordPress API Setting : the title of the section rendered not showing
- add_settings_section() order
- Splitting do_settings_sections within HTML?
- Why are these settings unregistered?
- Settings field is not showing up in the general options page
- How to use/retrieve an options array, with defaults, using get_option()
- Displaying errors with settings api
- Displaying validation message in options-general.php
- How I can Make two input field at add_settings_section
- Settings Page – Option won’t save in database
- Customize format of settings
- Seeking clarity on data sanitization fields for settings textarea
- How to create a WordPress options page
- When should I use register_setting() and add_settings_field()
- input on custom settings page adds http://
- How to retrieve the options from this options page?
- Is it possible to get a list of options for a specific options group?
- update_option_$option action not working as expected
- Saving array of data to database using wordpress settings API
- settings api sub menu and data not populating
- how to get wp_editor to save data in plugin admin page
- Getting all the settings for a plugin
- Can someone tell me where I’ve gone wrong with this plugin’s Settings page?
- Use the Settings API to whitelist a setting, but don’t output it
- How to handle complex data with Settings API
- Can’t save settings to database using Setting API
- Verify Submitted Form Values and Show Warning Messages with Setting API
- WordPress settings API VS Table In Database?
- settings api and the data passed in the parameter
- Writing Mysql and Php code in wordpress Posts
- Should I escape the html for the settings field created with add_settings_field?
- How to Save value from two inputs as array?
- Multiple checkbox doesn’t work in wordpress settings api
- Custom plugin: how do I call a PHP file if settings option is set to true?
- Assign value to custom checkbox using get_option()
- Multiple plugins linked to same settings page
- Settings page – can’t change checkbox to unchecked
- Add Logo Upload per Setting API
- Add two input fields in add_settings_field
- Custom setting field value not working inside add_action init hook
- settings api callback functions won’t display?
- Restrict access to options-*.php pages
- How to move setting field up a row on general page?
- Option doesn’t save
- Save button in theme customization page stays disabled
- Settings API Multiple Checkbox in General Settings
- Settings api sanatize callback not being triggered
- Can I use add_option for a plugin categories and how?
- Adding Form Fields with Settings API