Title: Optional Content
Author: kylegetson
Published: <strong>2010 年 3 月 15 日</strong>
Last modified: 2011 年 6 月 13 日

---

搜索插件

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

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

# Optional Content

 作者：[kylegetson](https://profiles.wordpress.org/kylegetson/)

[下载](https://downloads.wordpress.org/plugin/optional-content.1.1.zip)

 * [详情](https://cn.wordpress.org/plugins/optional-content/#description)
 * [评价](https://cn.wordpress.org/plugins/optional-content/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/optional-content/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/optional-content/#developers)

 [支持](https://wordpress.org/support/plugin/optional-content/)

## 描述

This plugin allows you to show or hide content on a page or post based on a simple
shortcode. You don’t need PHP knowledge, or a PHP enabling plugin. Simply use a 
button on the WYSIWYG editor to select under what condition you would like the content
displayed. Fast, simple, and safe. Keep your template files clean by removing your
PHP logic. Now allows shortcodes inside of the conditional content.

Display content based on the following conditions:

 * Manual on/off setting
 * Before, after, or between specific times (repeated daily)
 * Before, after or between specific dates
 * Based on if the visitor is logged in
 * Based on a specific user (by user id) or multiple users (by user id)
 * Based on GET variables (variables passed on the URL in the form of http://www.
   example.com/about/?test=value where the variable is ‘test’)
 * Based on POST variables (variables sent via forms)
 * Based on REQUEST variables (either GET or POST variables)

## 屏幕截图

 * [[
 * The editor button
 * [[
 * The window to insert the optional content

## 安装

 1. Upload the folder `optional-content` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Use the ‘[if]’ button now on the tinyMCE WYSIWYG editor.

## 常见问题

  I don’t see a new button on the editor?

Try clicking the ‘show/hide kitchen sink’ button. This will display additional buttons,
and may reveal the ‘[if]’ button. If not, clear your browser cache and try again.

  Can I do a date AND a time?

Yes, this plugin uses the PHP function strtotime(), so you can do date and time 
like ‘2010-12-31 23:59:59’ in the ‘date’ field for 12:59:59PM on Dec. 31 2010. See
the PHP documentation for strtotime() for more examples of what you can use.

## 评价

此插件暂无评价。

## 贡献者及开发者

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

贡献者

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

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

### 对开发感兴趣吗?

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

## 更新日志

#### 1.1

Fixed issues with selecting a user
 Added the ability for multiple users Now allows
for shortcodes inside shortcodes

#### 1.0.0

 * Plugin functional and tested by a small group of volunteers

## 额外信息

 *  版本 **1.1**
 *  最后更新：**15 年前**
 *  活跃安装数量 **40+**
 *  WordPress 版本 ** 2.8.0 或更高版本 **
 *  已测试的最高版本为 **3.1.4**
 *  语言
 * [English (US)](https://wordpress.org/plugins/optional-content/)
 * 标签
 * [conditional content](https://cn.wordpress.org/plugins/tags/conditional-content/)
   [if](https://cn.wordpress.org/plugins/tags/if/)[php](https://cn.wordpress.org/plugins/tags/php/)
 *  [高级视图](https://cn.wordpress.org/plugins/optional-content/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/optional-content/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/optional-content/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/optional-content/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/optional-content/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/optional-content/reviews/?filter=1)

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

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

## 贡献者

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

## 支持

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

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

## 捐助

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

 [ 捐助此插件 ](http://getson.info/)