WordPress函数文档check_import_new_users()
判断是否有导入新用户的权限 描述 This function is a conditional tag to …
判断是否有导入新用户的权限
描述
This function is a conditional tag to check if the current user has the required permissions to import new users.
用法
<?php check_import_new_users(); ?>
参数
This function does not accept any parameters.
示例
1
2
3
4
5
6
7
8
9
10
|
/* ———————————-
* wordpress函数 kim收集
* ———————————- */
<?php
if ( check_import_new_users() ) {
// We can import users.
} else {
// This user doesn’t have the required permissions.
}
?>
|
注意
- This function uses is_super_admin().
源文件
check_import_new_users() 函数的代码位于 wp-admin/includes/ms.php
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* ———————————-
* wordpress函数 kim收集
* ———————————- */
/**
* Checks if the current user has permissions to import new users.
*
* @since 3.0.0
*
* @param string $permission A permission to be checked. Currently not used.
* @return bool True if the user has proper permissions, false if they do not.
*/
function check_import_new_users( $permission ) {
if ( !is_super_admin() )
return false;
return true;
}
// See “import_allow_fetch_attachments” and “import_attachment_size_limit” filters too.
|
- 原文:http://codex.wordpress.org/Function_Reference/check_import_new_users
类别:WordPress函数文档、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
评论功能已经关闭!