The setting that is the first parameter is the not the option key. It is the key that you would’ve registered using register_setting
register_setting( 'settings_unique_key4172_91h, 'option_key', 'name_of_sanitiser_function' );
Then you can add settings errors like this, inside the callback
function name_of_sanitiser_function(){
add_settings_error(
'settings_unique_key4172_91h',
esc_attr( 'settings_updated' ),
$message,
$type
);
}
You might like a few tutorials. I agree personally that it is very confusing:
http://www.presscoders.com/2010/05/wordpress-settings-api-explained/
Related Posts:
- Hook if somebody saves plugin options?
- Where can I find a schema of wordpress plugin core architecture?
- How to Loop Plugin Option Field Set?
- Save and retrieve custom plugin options value
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- Using tabs for wordpress plugin
- How to handel multiple checkbox field in the admin settings page with Settings API
- Custom plugin settings: clicking “save changes” does not display success message
- How can I include a setting that has a variable number of values in a settings page using register_setting?
- Saving Plugin settings to the database
- check for the current screen
- Plugin set default setting value when it activated
- Get page slug in Admin menu
- Stop the form of beign submitted on “Save changes” custom option page
- Add a Custom Permalink option in the Permalink Admin Screen?
- Settings API – input always updates over validation
- Wp die causing 500 Internal Server Error?
- redirect on theme switch – WordPress
- Can’t get plugin settings page to save data
- Why this global array is returning NULL from a callback function
- How to get specific setting by settings_fields()?
- Most efficient way to use classes to create admin pages using Settings API
- Show admin notice on incorrect value on form field
- Cannot display settings field
- Checkbox conflict in my custom plugin admin page
- Bulk update all posts from plugin settings screen
- Change the display of Settings API (do_settings_sections)
- Settings API saved values not getting shown in the dropdownbox
- Can I use register_settings and unregister_setting once the settings page has loaded?
- Update WP option by plugin
- How to save plugin custom settings page fields
- How to change php variable value using wp setting api
- 500 error when updating plugin option
- How to make sure settings are not lost when plugin is updated?
- Editable select options in quick edit OR in plugin settings
- How to save Setting pages data to the database?
- update_option_{$option} not working (do function after options are saved)
- How do I render content from a wp_editor in a plugin setting field?
- Settings Fields not showing up in Submenu Page
- How to save the option’s new values plus old value without overwrite old one
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- How do I add a textarea (multirow) option to my WordPress plugin?
- WordPress Settings – Custom Button actions
- Option page not updating multiple records in settings api
- WordPress 4.1 plugin only save 1 field to database
- Creating a register settings class that supports extended classes
- Unable to Retrieve Setting Value for my Plugin
- Validating values using Settings API?
- Extend my plugin settings with hooks
- How can I save a setting field with multiple checkbox options generated by a foreach loop on a custom wordpress admin page?
- move setting data from wordpress api to codestar freamwork
- How to detect WP plugins used on a site
- Using WordPress as a CMS: Developer preferences for custom vs existing plugins
- Login with OpenID, similar to Stack Exchange sites?
- Preserve custom URL parameter on more pages
- WordPress Capabilities: edit_user vs edit_users
- Passing .pem and .key files in cURL doesn’t work in WordPress
- Is there a limit on the size of a WP page?
- How to restrict Front-End Editor on a page?
- How do I create a custom wordpress slideshow plugin?
- Skip file when plugin updated
- Are contributed plugin translations automatically installed in WordPress?
- Why would WP-CLI and WP Admin show different list of plugins with updates?
- Translating plugin inside the theme [closed]
- How to send little data between admin pages of my plugin?
- How to activate plugins for my WordPress sites from a remote server
- Register script in one plugin, and enqueue it in another
- how to load the language file in plugin?
- Getting a List of Categories for Use in a Plugin?
- How to get all of the activate_plugin action parameters?
- WP_Terms_List_Table Quick Edit not working
- file-gallery plugin line 1573 broken in 4.2 upgrade [closed]
- How do I use wp_editor() in widget form?
- Errors when trying to use a plugin to write to the database
- WPTouch – how to remove shortcodes or make shortcodes function
- Adding class to last list item? Not WP generated
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- Custom shortcode for displaying user based on a role parameter
- HTTP requests start hanging after I try activating all plugins, and only stop when I manually disable the plugins via DB
- Memory Management when developing plug-ins
- Load script only in the admin page
- Using AJAX to run SQL statement and populate dropdown
- Disable “auto embed” feature when pasting text and links
- SASS not showing in customized preloader plugin
- Lock content in WordPress website
- After updating theme & plugin I am getting an error message
- Get Current Post ID in WP Loop For GiveWP
- Unable to activate themes on localhost
- Identify if the_post hook is being called from the admin post list
- wordpress ajax pagination object value does not change
- Reorganization of namespaces
- Passing a parameter to filter and action functions
- Holding 2 wp_user in the same action (to update billing_email when user_email is updated)
- How to get the real address from a url (permalink)
- 404 Page when emptying spam or deleting a plugin
- File permissions for wp-minify plugin
- How to declare this function correctly?
- Plugin version number after code rewrite [closed]
- I want to allow certain file types on dokan upload files
- How to create different woocommerce single_product.php pages for each product? [closed]