首页 WordPress函数大全 add_option_update_handler()

add_option_update_handler()

2020-05-01 / 2401阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

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

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

Register a setting and its sanitization callback

描述

See also See also

  • register_setting()

Top ↑

参数

$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: ''

大家谈论
    我的见解