Title: WP isAdmin
Author: Blaine Moore
Published: <strong>2020 年 9 月 18 日</strong>
Last modified: 2022 年 5 月 16 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wp-isadmin.svg)

# WP isAdmin

 作者：[Blaine Moore](https://profiles.wordpress.org/blaine-moore/)

[下载](https://downloads.wordpress.org/plugin/wp-isadmin.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-isadmin/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-isadmin/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/wp-isadmin/#developers)

 [支持](https://wordpress.org/support/plugin/wp-isadmin/)

## 描述

This plugin provides provides a simple short code to add or hide custom content 
to your posts and pages based on whether a user is an administrator (or other role)
or not.

This started as a way around having an automatic redirect if somebody belonged to
a specific WishListMember membership level but not wanting to redirect _off_ of 
the page
 if I was an admin (who always has access to all membership levels.)

## 屏幕截图

[⌊A simple example for how to use the shortcodes.⌉⌊A simple example for how to use
the shortcodes.⌉[

A simple example for how to use the shortcodes.

[⌊An example that includes a javascript redirect for WishListMember private tags,
which still allows the admin user to stay on the page.⌉⌊An example that includes
a javascript redirect for WishListMember private tags, which still allows the admin
user to stay on the page.⌉[

An example that includes a javascript redirect for WishListMember private tags, 
which still allows the admin user to stay on the page.

## 常见问题

### What shortcodes are available?

[isAdmin][/isAdmin] and [isNotAdmin][/isNotAdmin] are both supported, and will only
show or hide the content (respectively) if the user is logged in and has an administrator
role (by default).

### Can I specify other roles than just the administrator role?

Yes, you can set the _role_ or _roles_ attribute. So if you’d like content that 
can only be seen by users with the “editor” role, you would use: [isAdmin roles=”
editor”][/isAdmin].

### Can I specify more than one role?

Yes, just provide a comma-separated list to the _roles_ attribute. For example: [
isAdmin roles=”editor,administrator”][/isAdmin]

### What is the difference between the *role* and *roles* attributes?

There is no difference; both are available as a convenience as I expected that if
I wanted to change it I wouldn’t remember if I needed it to be plural or not and
it would seem odd to specify a plural attribute for a singular condition (and vice
versa.) Basically, choose one or the other (if you want something other than checking
for administrator) and it will work as expected. If you specify both, then the _roles_
attribute takes precedence unless you set it to the default, in which case it will
use the _role_ attribute.

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP isAdmin」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Blaine Moore ](https://profiles.wordpress.org/blaine-moore/)

[帮助将「WP isAdmin」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-isadmin)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-isadmin/)，查看[SVN仓库](https://plugins.svn.wordpress.org/wp-isadmin/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/wp-isadmin/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-isadmin/)。

## 更新日志

= 1.0.1 (2020-09-17)=
 * Initial Version

## 额外信息

 *  版本 **1.0.1**
 *  最后更新：**4 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 4.7 或更高版本 **
 *  已测试的最高版本为 **6.0.0**
 *  PHP 版本 ** 7.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-isadmin/)
 * 标签
 * [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-isadmin/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/wp-isadmin/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-isadmin/reviews/)

## 贡献者

 *   [ Blaine Moore ](https://profiles.wordpress.org/blaine-moore/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-isadmin/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.charitynavigator.org/index.cfm?bay=search.summary&orgid=7614)