內容簡介
這個外掛增加了一個簡單易用的短碼 [ot_get_option],可以像使用函式 ot_get_option() 一樣從類似的資訊中獲取資料。它支援和 ot_get_option() 相同的值,非常容易使用。
注意:它不適用於返回非文本值的選項。
為什麼使用短碼而不是 PHP 函式?有時我需要實現略有不同的類似網站。這允許我在使用者界面中設置選項,並根據需要將值傳播到帖子內容中,而無需記住每個需要更改的地方。
如果您沒有使用 OptionTree ( https://wordpress.org/plugins/option-tree/ ),這個外掛可能對您沒有用!
使用方式如下:
[ot_get_option option_id="XYZ" default="123"]
這等同於以下 PHP 寫法:
ot_get_option("XYZ","123");
歡迎參與貢獻:https://github.com/ethanpil/wp-optiontree-shortcode
外掛標籤
開發者團隊
原文外掛簡介
This plugin adds a shortcode [ot_get_option] to pull info from like the function ot_get_option(). Its very simple to use and supports the same values as ot_get_option().
BEWARE: It will not work with options that return non-text values.
Why a shortcode and not the function in PHP? Sometimes I need to implement slight variations of the same site. This allows me to set my options in the UI and have the values propagate into the post content as needed without remembering every place that needs changes.
If you aren’t using OptionTree ( https://wordpress.org/plugins/option-tree/ ) this will probably be useless for you!
Its used like this:
[ot_get_option option_id="XYZ" default="123"]
This is the equivalent of the following in PHP:
ot_get_option("XYZ","123");
Fork away: https://github.com/ethanpil/wp-optiontree-shortcode
