add_option_update_handler()
Deprecated since 3.0.0. It is no longer supported and may be removed in future releases. Use register_setting() instead.
Register a setting and its sanitization callback
No Hooks.
Returns
null. Nothing (null).
Usage
add_option_update_handler( $option_group, $option_name, $sanitize_callback );
- $option_group(string) (required)
- A settings group name. Should correspond to an allowed option key name.
Default:allowed option key names include 'general', 'discussion', 'media', 'reading', 'writing', and 'options' - $option_name(string) (required)
- The name of an option to sanitize and save.
- $sanitize_callback(callable)
- A callback function that sanitizes the option's value.
Default:''
Notes
- See: register_setting()
Changelog
| Since 2.7.0 | Introduced. |
| Deprecated since 3.0.0 | Use register_setting() |
add_option_update_handler() add option update handler code WP 7.0
function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );
register_setting( $option_group, $option_name, $sanitize_callback );
}