add_option_update_handler

DeprecatedDeprecated

This function has been deprecated. Use register_setting() instead.

SummerySummery

Register a setting and its sanitization callback

Syntax

add_option_update_handler( string $option_group, string $option_name, callable $sanitize_callback = '' )

ParametersParameters

$option_group

(string) (Required) A settings group name. Should correspond to a whitelisted option key name. Default whitelisted option key names include 'general', 'discussion', 'media', 'reading', 'writing', 'misc', 'options', and 'privacy'.

$option_name

(string) (Required) The name of an option to sanitize and save.

$sanitize_callback

(callable) (Optional) A callback function that sanitizes the option's value.

Default value: ''

SourceSource

File: wp-admin/includes/deprecated.php


			

ChangelogChangelog

Changelog
Version Description
3.0.0 Use register_setting()
2.7.0 Introduced.

See alsoSee also

Scroll to Top