[WordPress] 外掛分享: WP247 Get Option Shortcode

首頁外掛目錄 › WP247 Get Option Shortcode
10+
安裝啟用
尚無評分
1669 天前
最後更新
問題解決
WordPress 4.0+ v1.2 上架:2015-04-08

內容簡介

這個外掛可以在任何短代碼支援的地方加入 WordPress 選項。

語法

[wp247_get_option option=”欲取得的選項” default=”預設值” scope=”取得範圍“]

其中:

欲取得的選項是要從 WordPress wp_options 資料表中檢索的選項。預設值: none

預設值是在所需選項不存在時返回的預設值。預設值: “”

取得範圍表示要取得哪種類型的選項。 scope=”site” 將使用 WordPress get_site_option 函式檢索選項。所有其他值都會忽略,並使用 WordPress get_option 函式檢索所需的選項值。預設值: “”

範例

在任何地方的文字中加入 WordPress 網站 URL:

這是我的網站 URL:[wp247_get_option option=”siteurl”]。

在頁尾小工具中設置版權聲明:

版權所有 © [wp247_get_option option=’blogname’]。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP247 Get Option Shortcode」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Include WordPress options anywhere shortcodes are accepted.
Syntax
[wp247_get_option option=”desired-option” default=”desired-default” scope=”desired-scope“]
where:

desired-option is the option to be retrieved from the WordPress wp_options table. Default: none

desired-default is the default value to be returned if the desired option does not exist. Default: “”

desired-scope indicates which type of option is to be retrieved. scope=”site” will retrieve options using the WordPress get_site_option function. All other values are ignored and the WordPress get_option function will be used to retrieve the desired option value. Default: “”

Examples
Include the WordPress site URL in some text somewhere:

This is my site’s URL: [wp247_get_option option=”siteurl”].

Set up a copyright notice in a footer widget:

Copyright © [wp247_get_option option=’blogname’]. All rights reserved.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon