add_option_update_handler() – Register a setting and its sanitization callback

You appear to be a bot. Output may be restricted

Description

Register a setting and its sanitization callback

Usage

add_option_update_handler( $option_group, $option_name, $sanitize_callback );

Parameters

$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 ) optional – Optional. A callback function that sanitizes the option's value.

Returns

void

Source

File name: wordpress/wp-admin/includes/deprecated.php
Lines:

1 to 4 of 4
function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
  _deprecated_function( add_option_update_handler, '3.0.0', 'register_setting()' );
  register_setting( $option_group, $option_name, $sanitize_callback );
}
 

 View on GitHub View on Trac