check_import_new_users()判断是否有导入新用户的权限

目录

描述

This function is a conditional tag to check if the current user has the required permissions to import new users.

check_import_new_users() 描述

用法

<?php check_import_new_users(); ?>

check_import_new_users() 用法

参数

This function does not accept any parameters.

check_import_new_users() 参数

示例

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */

<?php

if ( check_import_new_users() ) {
    // We can import users.
} else {
    // This user doesn't have the required permissions.
}

?>

check_import_new_users() 示例

注意

check_import_new_users() 注意

源文件

check_import_new_users() 函数的代码位于 wp-admin/includes/ms.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * 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.

check_import_new_users() 源文件