Always develop with WP_DEBUG
set to TRUE
. You’ve a typo:
array_push($valid_input[$id], $input[$id];
(missing )
after the array_push
)
You can’t push to arrays that are not … arrays.
// So, check this before pushing:
$valid_input[$id] = ! is_array( $valid_input[$id] ) ? (array) $valid_input[$id] : $valid_input[$id];
Related Posts:
- How to pass arguments from add_settings_field() to the callback function?
- How to pass variable to add_settings_section() callback?
- Difference between Option_Group and Option_Name in Register_Settings
- Settings API – creating reusable form elements?
- Settings API – changing add_settings_field() output?
- register_setting() vs add_option()
- Setting ‘autoload’ to ‘no’ with Settings API
- How to Save Different Settings Options Using Settings API and/or the Theme Optimizer
- Serialized settings in rest api
- Can’t output do_settings_sections . Can’t understand why
- Settings API – how to update multiple options manually?
- Single callback with multiple setting fields
- Settings API – how to update options manually?
- how can I detect that option value has changed?
- How to save WordPress Options as an array?
- How to display some settings for super admin user only using Settings API
- Is there a limit to the number of options you can store in one settings field of wp_options?
- Settings API get_option best practices
- Custom theme options Radio inputs not saving
- Settings API: Change position of custom setting field
- Tab from Settings API resetting all options with INSERT INTO [closed]
- Getting settings saved two times in settings page with tab
- get_option array value defaults and best practices
- The Settings API – What is the purpose of default value in register_setting?
- settings_fields doesn’t appear to be running
- Settings API – Separating PHP and HTML
- Two settings_fields in one form
- Echoing a variable inside a function
- Settings API validation callback
- How to save custom settings api fields with custom section fuction
- How to retrieve the options from this options page?
- How do I retrieve multiple values from a multidimensional array in wp_options?
- Add description to custom plugin setting
- Settings API and ‘type’ => ‘font’
- WP Page Options Array
- ‘delete_option()’ only deleting the value, not the key/value pair
- How to add a Reset to Defaults button with Settings API?
- Retrieve my custom settings in the settings/ API endpoint
- Is it possible to have a global parameter page which allows to configure other plugins in the same place?
- Multiple checkbox doesn’t work in wordpress settings api
- Is there a standard technique or API for getting the site header image?
- Help to create the best plugin settings!
- WordPress Settings API Overrides My Previous Value
- How to save Checkbox-Options in Plugin Options Page
- Problem with checkbox in Settings API
- Options saved and called in wrong order
- User specific settings, limited by role
- Access saved Options / Settings
- Dynamically Update Key in Associative Array When Saving Settings
- Incorporating the Settings API in WordPress Themes – by Chip Bennet
- How to add options for Pages?
- options validator input is false?
- Best place to store company address
- Where to adjust presets for slider options “auto rotate” (3, 5, 10, 15 seconds)? [closed]
- change backend header options
- Are all options loaded to memory on each request?
- Is get_option function cached?
- Using widget options ‘outside’ the widget
- How to load WordPress on non WP page?
- Options for CDN with WordPress Including Supporting Plugins?
- Add_settings_field() parameterizing callback?
- Updating wp_options with an array on save_post results in duplicated entries
- Editor role not saving settings page for custom post type
- Cannot update my options using wp_ajax
- Which WordPress option stores the current active theme?
- update_option method with support of utf8
- Best practice differences in DB options and wp-config between live, staging and local WordPress environments?
- Logout redirects to a broken page(home URL is omitted)
- Settings API – input always updates over validation
- How to save array of datas in option page by setting api?
- Correct way check nonce (security) using old Options API
- Character Encoding for wp_options
- Clone plugins (and settings) to new installation?
- Storing HTML in wp_options
- Custom delete option button in plugin settings
- Run function on settings save
- Settings API not saving values to database
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error
- Different Front page for Mobile
- Flush rewrite rules on option update with Settings API
- How to save user meta on custom admin page
- Is there an optimized, WordPress-y way to not call a `get_option` twice?
- Save and user submitted data from a form and display them in the wp backend
- get_option and list of options
- update_option_$option action not working as expected
- not getting API setting saved confirmation message after update on option page
- How to save plugin custom settings page fields
- Assigning a Setting to a Variable and Using it in an if Statement
- Getting all the settings for a plugin
- Theme Option select values
- Ways of dealing with nested arrays within option
- Drop Down options aren’t saving in my wordpress plugin options page
- Option value not get saved in the database
- Whats the best practise on how to store json data from a custom settings page?
- How do I add a textarea (multirow) option to my WordPress plugin?
- Repeatable option fields not saving
- Settings API retrieving options database information alongside with user information?
- Add_menu_page and saving settings
- Option does not save or update upon page refresh
- save array of objects with update_option