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

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 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://tw.wordpress.org/plugins/optional-content/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/optional-content/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/optional-content/#installation)
 * [開發資訊](https://tw.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 editor button⌉[

The editor button

[⌊The window to insert the optional content⌉⌊The window to insert the optional content⌉[

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 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.1.4**
 *  語言
 * [English (US)](https://wordpress.org/plugins/optional-content/)
 * 標籤:
 * [conditional content](https://tw.wordpress.org/plugins/tags/conditional-content/)
   [if](https://tw.wordpress.org/plugins/tags/if/)[php](https://tw.wordpress.org/plugins/tags/php/)
 *  [進階檢視](https://tw.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/)