This page redirects to an external site: https://developer.wordpress.org/reference/hooks/sanitize_option_option/
sanitize_option_$option is a filter applied to an option value to be cleaned up by the function sanitize_option(). There is one filter per option name; the $option in the filter name stands for the name (e.g. 'sanitize_option_blogname', 'sanitize_option_siteurl'). You can use this filter to define a sanitizer for your own options. See the notes for sanitize_option() for a list of existing options.
# filter existing options
function sanitize_builtin_option($value, $option) {
//...
}
add_filter('sanitize_option_admin_email', 'sanitize_builtin_option', 10, 2);
add_filter('sanitize_option_new_admin_email', 'sanitize_builtin_option', 10, 2);
//...
# filter your own options
function sanitize_url($value, $option) {
//...
}
add_filter('sanitize_option_feed_url', 'sanitize_url, 10, 2);
add_filter('sanitize_option_wpi_endpoint', 'sanitize_url', 10, 2);
add_filter('sanitize_option_contact_email', 'sanitize_email');
if (! function_exists('lg')) {
function lg($x) {
return log($x) / log(2);
}
}
function sanitize_blocksize($value) {
return pow(2, ceil(lg($value)));
}
add_filter('sanitize_option_blocksize', 'sanitize_blocksize');
add_option('blocksize', 200); # 256 gets stored for blocksize
sanitize_option() were passed through a sanitize_option filter.This filter is applied by sanitize_option in wp-includes/formatting.php