add_option_update_handler()WP 2.7.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. Use register_setting() instead.

Register a setting and its sanitization callback

No Hooks.

Return

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

Changelog

Since 2.7.0 Introduced.
Deprecated since 3.0.0 Use register_setting()

add_option_update_handler() code WP 6.5.2

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 );
}