前言介紹
- 這款 WordPress 外掛「functionsCapacitor」是 2012-02-27 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2014-10-29,距離現在已有 3840 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
api | post | codex | content | shortcode |
內容簡介
將 WordPress API 嵌入內容中。
您可以在文章、頁面或小工具內的參數使用相同的語法請求某些 WordPress API 函數。
functionsCapacitor 會將函數結果插入內容作為 HTML 輸出。
(*) 可查看 支援的函數
或條件標記。
功能
可安全地使用此外掛在 WordPress MU 或 WP MultiSite 上。
允許個性化內嵌輸出
每個功能。
簡單而強大的函數引數語法
以應用任何 WordPress API 選項。
使用魔法關鍵字的通用函數引數。
新增:使用WordPress 條件標記作為選項來顯示小工具。
結構化的原始碼以防止任何衝突。
使用 WordPress API 函數的三種方法:
使用短碼標籤的方法
在內容中插入類似 [fct function_name=”parameter1=value¶meter2=value”] 的標籤。
一個短碼標籤可以請求多個函數,輸入 [fct function_name1=”arguments” function_name2=”arguments”]。
使用小工具的方法
新增一個 functionsCapacitor 小工具,選擇一個函數,輸入函數參數,如 “parameter1=value¶meter2=value”(不含引號)。
可選:選擇一個支援的條件標記來決定在哪裡顯示小工具。
使用自訂欄位的方法
設置自訂欄位名稱為函數名稱,並將函數參數放入自訂欄位值中,例如 “parameter1=value¶meter2=value”(不含引號)。
結果始終插入在最後。
外掛優先級為 5。大多數外掛使用優先級 10。
如果顯示文章/頁面,則適用於此方法。
範例
熱門文章標籤的標籤雲,
插入 [fct wp_tag_cloud]
當前頁面的子頁面列表,
插入 [fct wp_list_pages=”title_li=&child_of=%postID%&depth=1″]
帶有節錄的分類最新文章列表,
插入 [fct wp_get_recent_posts=”category=X&fct:show_excerpt=1″]
其中 X 是分類 ID 編號。
不包含預設分類的分類列表,
插入 [fct wp_list_categories=”title_li=&exclude=%defaultcatID%”]
內嵌輸出
所有 functionsCapacitor 請求都會插入
短碼方法可個性化主要容器,例如
[fct container=”HTML 標籤名稱” class=”類別(名稱)” style=”CSS 屬性” function1=”args” function2=”args”]。
將 container=”” 設為移除主要容器。
一些函數輸出是插入在內容最下方。
原文外掛簡介
Back WordPress API to the content.
You can request some* functions of WordPress API with same syntax for arguments into your posts, pages, or widgets content.
functionsCapacitor will insert function result into your content as HTML output.
(*) see Supported functions
or conditional tags.
Features
Safe process to use this plugin on WordPress MU or WP MultiSite.
Allow to personalize Embedded output
for each functions.
Easy and powerfull Functions arguments syntax
to apply any WordPress API options.
Generic functions arguments with Magic keywords.
NEW: use WordPress conditional tags as option to display a widget.
Structured source-code to prevent any conflict.
Three methods to use WordPress API functions :
Method by shortcode tag
Insert a tag into your content like [fct function_name=”parameter1=value¶meter2=value”].
One shortcode tag can request several functions, input [fct function_name1=”arguments” function_name2=”arguments”].
Method with a widget
Add a functionsCapacitor widget, select a function, input function parameters like “parameter1=value¶meter2=value” (without quotes).
Optional: choose a supported conditional function to decide where to display your widget.
Method by custom fields
Set a custom field name with function name and put function arguments into custom field value like “parameter1=value¶meter2=value” (without quotes).
Result is always inserted at end.
Plugin has priority 5. Most plugins use priority 10.
This method is applied if post/page is displayed.
Examples
Tag cloud of popular posts tags,
insert [fct wp_tag_cloud]
List of children pages of current page,
insert [fct wp_list_pages=”title_li=&child_of=%postID%&depth=1″]
List of category’s recent posts with excerpts,
insert [fct wp_get_recent_posts=”category=X&fct:show_excerpt=1″]
with X equal category ID number
List of categories without default category,
insert [fct wp_list_categories=”title_li=&exclude=%defaultcatID%”]
Embedded output
Any functionsCapacitor request will insert
.
Shortcode method allow to personalize main container like
[fct container=”HTML tag name” class=”class(es) name(s)” style=”CSS properties” function1=”args” function2=”args”].
set container=”” to remove main container.
Some functions output were inserted with dedicated container like
function output
or
.
Personalize this container with Special functions parameters.
Functions arguments syntax
Follow these examples to setup your requests :
“parameter1=something¶meter2=25”,
parameter1 and parameter2 typed as strings.
“parameter1=something¶meter2=false”,
parameter2 typed as boolean.
“parameter1=¶meter2= ¶meter3=””,
any parameters equal empty string.
“parameter1= something ¶meter2=’ something ‘”,
parameter1 equal ‘something’,
parameter2 equal ‘ something ‘.
“parameter1=something¶meter2=array(‘something’,’something’)”,
parameter2 typed as an array of 2 strings.
“parameter1=something¶meter2=array(10,5,20)”,
parameter2 typed as an array of 3 integers.
“parameter1=something¶meter2=array(true,false)”,
parameter2 typed as an array of 2 booleans.
Not supported issues :
parameter’s value can’t contain “&” or “=” characters.
parameter’s value can’t contain an associative array like array(‘name’=>value,’name’=>value).
parameter’s value can’t contain an array of arrays.
parameter’s value can’t contain a PHP variable like $post->ID,
see Magic keywords.
parameter’s value can’t request a PHP or WordPress function.
parameter’s value can’t contain PHP source-code.
Magic keywords
Use these keywords to obtain variables values into your functions arguments :
%postID% => $post->ID,
ID of post or page where made the request :
related post/page into a shortcode,
or current post/page into a widget.
%postparent% => $post->post_parent,
ID of parent page where made the request.
%postauthor% => $post->post_author,
author ID of post where made the request.
%defaultcatID% => default_category,
ID of default category for newest posts.
%posttagIDs% => wp_get_post_tags(),
string of current post tags IDs as “1,2,3,…”
%posttagslugs% => wp_get_post_tags(),
string of current post tags slugs as “slug-name,slug-name,…”
You can use magic keywords into an array.
Example: wp_list_categories=”exclude=array(%defaultcatID%,1,2,…)”
Special functions parameters
fct:container to set HTML tag of function container.
Set “fct:container=”” to remove this container.
Each functions have a default container related to its output.
fct:container_id to set container “id” attribute.
fct:container_class to set container “class” attribute.
Function name as default.
Example with shortcode: [fct function_name=”fct:container_class=name¶m1=value¶m2=value”].
fct:container_style to set container “style” attribute.
functionsCapacitor not create a container if the API function still return a container.
See WordPress Codex to personalize them.
Supported functions
get_the_post_thumbnail()
with size=thumbnail|medium|large|post-thumbnail
or size name defined with add_image_size() into theme’s file functions.php.
get_the_tag_list()
with before=”&sep=’ ‘&after=” as default,
apply only on page or post,
rendered into DIV container
wp_get_archives()
with echo=0&format=html as default
wp_get_recent_posts()
rendered as list with UL container,
with exclude=%postID%&suppress_filters=false&post_status=publish&fct:perm=readable as default
(see bellow)
wp_list_authors()
with echo=0 as default
wp_list_bookmarks()
with echo=0 as default
wp_list_categories()
with echo=0 as default
wp_list_pages()
with echo=0 as default
wp_nav_menu()
with echo=false as default,
see Codex to setting its container
wp_tag_cloud()
with echo=0 as default,
format=flat|list only
See WordPress Codex about these functions and their arguments syntax.
Need you to support more functions, mail to [email protected]
wp_get_recent_posts()
if fct:perm=readable hide draft, future, pending, protected posts
but display private posts if user is allowed.
if fct:perm=” not output permalink of draft, future, pending, private posts.
set fct:show_excerpt=1|true to display posts excerpts.
set fct:show_date=1|true to display posts dates.
set fct:show_thumbnail=1|true to display post thumbnail,
with fct:thumbnail_size=thumbnail|medium|large|post-thumbnail
or size name defined with add_image_size() into theme’s file functions.php.
fct:show_thumbnail=true if fct:thumbnail_size is defined
display excerpt and thumbnail for draft, future, pending, private, and protected posts
but not create an excerpt from content.
Supported conditional functions
cat_is_ancestor_of()
check if current category is child of conditional argument.
in_category()
is_category()
is_front_page()
is_home()
is_page()
is_single()
See WordPress Conditional Tags about these functions and their arguments syntax.
Not canonical conditional functions
These functions are designed for this plugin only, not available elsewhere, and not documented into the WordPress Codex.
in_tree_of()
check if page, post, or category is descendant of conditional argument (or itself),
require argument as page or category numeric ID.
is_category_in_tree_of()
check if category is descendant of conditional argument (or itself),
require argument as category numeric ID.
is_page_descendant_of()
check if page is descendant of conditional argument,
require argument as page numeric ID.
is_page_in_tree_of()
check if page is descendant of conditional argument (or itself),
require argument as page numeric ID.
is_single_in_tree_of()
check if post is in descendant of conditional argument,
require argument as category numeric ID.
Conditional functions arguments syntax
Support only arguments as single value ; string, numeric, or magic keyword.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「functionsCapacitor」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.8 | 0.9 | 0.9.2 | 0.9.3 | 0.9.4 | 0.9.5 | 0.9.6 |
延伸相關外掛(你可能也想知道)
WP Shortcodes Plugin — Shortcodes Ultimate 》Shortcodes Ultimate 是一個全面的視覺與功能性元素收集,您可以在文章編輯器、文字小工具甚至是範本檔案中使用。使用 Shortcodes Ultimate,您可以輕鬆地建...。
MW WP Form 》MW WP Form 可以使用 shortcode 創建帶有確認畫面的郵件表單。, , 使用 shortcode 創建表單, 可以使用確認頁面。, 頁面可以使用相同的 URL 或個別的 URL 進行...。
Shortcoder — Create Shortcodes for Anything 》Shortcoder 外掛可讓您建立 HTML、JavaScript、CSS 和其他代碼片段的自訂捷徑。現在,這些捷徑可以在文章/頁面中使用,並且該片段將取代其位置。, ✍ 輕鬆建立...。
Display Posts – Easy lists, grids, navigation, and more 》Display Posts 讓您輕鬆地列出網站上的所有內容。首先在內容編輯器中新增此短碼,以列出最近的文章清單:, [display-posts], , 按類別篩選, 若只想顯示特定類...。
Widget Shortcode 》這個短碼需要小工具的ID,但不需要猜測,外掛會為你生成代碼。如果你想要覆蓋小工具的標題,你可以使用 "title" 參數:, [widget id=”text-1″...。
Woody code snippets – Insert Header Footer Code, AdSense Ads 》需要專業的支援嗎?, 免費獲取支援, 開始獲得高級支援, , 停止反覆使用相同的內容!, 停止插入 function.php 中的 PHP 代碼!, 停止將 Google Analytics、Yan...。
Column Shortcodes 》此外掛提供簡單易用的短碼,在您的文章或頁面中輕鬆創建欄位。有時候,您只需要將網頁切成不同的欄位。使用此外掛,您只需選擇一個欄位的短碼,便可將欄位加...。
amr shortcode any widget 》使用shortcode將小工具或多個小工具或整個小工具區域(側邊欄)插入到頁面中。, 首先在正常的側邊欄中設置小工具。 檢查它是否正常運作。, 然後將所選小工具...。
Shortcode in Menus 》此外掛讓你可以在 WordPress 導覽選單中使用簡碼,以便可以動態生成連結。也可以讓你在導覽選單中添加完整的 HTML 段落。, 使用方法, 查看截圖。, 另外,查看...。
Sidebar Widgets by CodeLights 》❗ 很抱歉,由於 SiteOrigin 的 widgets API 完全更改,CodeLights 不再支援 SiteOrigin Page Builder 的原生使用。解決方案:您仍然可以在純文字編輯器中創...。
Advanced iFrame 》看起來您正在尋找一個 WordPress 外掛 - Advanced iFrame Pro。這個外掛可讓您使用 iframe 包含其他網頁到您的網站中,同時具有隱藏和修改元素、自動調整高度...。
Insert Pages 》Insert Pages 可讓您使用 Shortcode API,將任何 WordPress 內容(例如,頁面、文章、自訂文章類型)嵌入其他 WordPress 內容。它還包括一個小工具,可將頁面...。
Shortcodes by Angie Makes 》Shortcodes by Angie Makes 外掛為您的 WordPress 主題新增一系列易於使用的短碼,這些短碼與 Angie Makes WordPress 主題 完美搭配。, 範例, 請到此查看這些...。
Team Members 》這個外掛會為管理員面板增加一個「團隊」區塊,讓您可以輕鬆地在網站上展示您的員工/職員。您可以快速地將成員加入您的團隊,加入他們的照片、職位、個人簡介...。
Post Snippets – Custom WordPress Code Snippets Customizer 》, 建立自訂短碼和可重複使用的內容,並將它們插入到您的文章和頁面中。, , 此外掛讓您建立 HTML、PHP 程式碼或常用文字片段的庫。在文章和頁面中,您可以使用...。