sanitize_option() | 根据WordPress选项的性质清理各种选项值

猫斯基 4 2015-01-23

函数

sanitize_option( string $option, string $value )

描述

这基本上是一个 switch 语句,它将根据 $option 通过多个函数传递 $value

参数

$option,( string ) (必需) 选项的名称。

$value,( string ) (必需) 未净化的值。

$option选项值有:

admin_email
new_admin_email
thumbnail_size_w
thumbnail_size_h
medium_size_w
medium_size_h
large_size_w
large_size_h
mailserver_port
comment_max_links
page_on_front
page_for_posts
rss_excerpt_length
default_category
default_email_category
default_link_category
close_comments_days_old
comments_per_page
thread_comments_depth
users_can_register
start_of_week
posts_per_page
posts_per_rss
default_ping_status
default_comment_status
blogdescription
blogname
blog_charset
blog_public
date_format
time_format
mailserver_url
mailserver_login
mailserver_pass
upload_path
ping_sites
gmt_offset
siteurl
home
WPLANG
illegal_names
limited_email_domains
banned_email_domains
timezone_string
permalink_structure
category_base
tag_base

返回值

(字符串)清理后的值。

猫斯基·划重点

相关函数

来源

文件:wp-includes/formatting.php

更新日志

版本 描述
2.0.5 介绍。

示例

本文由 猫斯基 原创发布。

著作权均归用户本人所有。独家文章转载,请联系本站管理员。获得授权后,须注明本文地址! 本文地址:https://www.maosiji.com/wordpress-sanitize_option.html