Title: Get User Role
Author: theslink2000
Published: <strong>2012 年 11 月 25 日</strong>
Last modified: 2012 年 11 月 25 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/get-user-role.svg)

# Get User Role

 由 [theslink2000](https://profiles.wordpress.org/theslink2000/) 開發

[下載](https://downloads.wordpress.org/plugin/get-user-role.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/get-user-role/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/get-user-role/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/get-user-role/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/get-user-role/#developers)

 [技術支援](https://wordpress.org/support/plugin/get-user-role/)

## 外掛說明

This plugin doesn’t do anything on the surface but if you call the get_user_role()
function then you can achieve one of two results.

Function

Returns the role of the specified user.

Usage

Parameters

$user_id
 (string)(optional) ‘username’

Return Values

(string) If no $user_id is specified in the function call the function will return
the role of the currently logged in user, otherwise the role of the specified user
will be returned.

Examples

$role = get_user_role(“admin”);

This will return “administrator”.

Notes

This plugin may call the following global variables:

$current_user
 $wp_roles $wpdb

This plugin is designed to work with any correctly made custom roles.

## 安裝方式

This section describes how to install the plugin and get it working.

e.g.

 1. Upload `get_user_role.zip` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Call get_user_role() as required

## 常見問題集

  Can I use you plugin within my own plugins?

Of course you can, so long as you ask first. Just send me a message and add my name
to the Contributors section.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Get User Role〉的開發相關工作。

參與者

 *   [ theslink2000 ](https://profiles.wordpress.org/theslink2000/)

[將〈Get User Role〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/get-user-role)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/get-user-role/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/get-user-role/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/get-user-role/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/get-user-role/)。

## 變更記錄

#### 1.0

 * Creation.

## 中繼資料

 *  版本 **1.0**
 *  最後更新 **14 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 3.0.1 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.4.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/get-user-role/)
 * 標籤:
 * [roles](https://tw.wordpress.org/plugins/tags/roles/)[users](https://tw.wordpress.org/plugins/tags/users/)
 *  [進階檢視](https://tw.wordpress.org/plugins/get-user-role/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/get-user-role/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/get-user-role/reviews/)

## 參與者

 *   [ theslink2000 ](https://profiles.wordpress.org/theslink2000/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/get-user-role/)