add_option_whitelist( array $new_options, string|array $options = '' )
Adds an array of options to the options whitelist.
描述
参数
- $new_options
-
(array)
(Required) - $options
-
(string|array)
(Optional)Default value: ”
返回值
(array)
源代码
File: wp-admin/includes/plugin.php
function add_option_whitelist( $new_options, $options = '' ) {
if ( $options == '' )
global $whitelist_options;
else
$whitelist_options = $options;
foreach ( $new_options as $page => $keys ) {
foreach ( $keys as $key ) {
if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) {
$whitelist_options[ $page ] = array();
$whitelist_options[ $page ][] = $key;
} else {
$pos = array_search( $key, $whitelist_options[ $page ] );
if ( $pos === false )
$whitelist_options[ $page ][] = $key;
}
}
}
return $whitelist_options;
}
更新日志
Version | 描述 |
---|---|
2.7.0 | Introduced. |
相关函数
Used By
-
wp-admin/includes/plugin.php:
option_update_filter()
User Contributed Notes
-
Skip to note content
You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note
Contributed by
David Brumbaugh
Here’s a nice little tutorial that uses add_option_wp_whitelist: http://wpmututorials.com/how-to/writing-plugins/
你可能对这些文章感兴趣:
- wordpress函数get_all_post_type_supports()用法示例
- wordpress函数get_all_user_settings()用法示例
- wordpress函数get_all_category_ids()用法示例
- wordpress函数get_all_page_ids()用法示例
- wordpress函数get_allowed_mime_types()用法示例
- wordpress函数get_allowed_themes()用法示例
- wordpress函数get_alloptions_110()用法示例
- wordpress函数get_allowed_http_origins()用法示例
- wordpress函数get_alloptions()用法示例
- wordpress函数get_admin_users_for_domain()用法示例
- wordpress函数get_admin_page_title()用法示例
- wordpress函数get_admin_url()用法示例
- wordpress函数get_adjacent_post_rel_link()用法示例
- wordpress函数get_admin_page_parent()用法示例
如有疑问,请前往问答中心反馈!
反馈