WordPress开发者和主题制作者的搜索引擎



add_option_update_handler ›

Since2.7.0
已弃用3.0.0
add_option_update_handler ( $option_group, $option_name, $sanitize_callback = '' )
参数: (3)
  • (string) $option_group A settings group name. Should correspond to a whitelisted option key name. Default whitelisted option key names include "general," "discussion," and "reading," among others.
    Required: Yes
  • (string) $option_name The name of an option to sanitize and save.
    Required: Yes
  • (callable) $sanitize_callback A callback function that sanitizes the option's value.
    Required: No
    默认: (empty)
查看:
定义在:
文档:

Register a setting and its sanitization callback



源码

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