
內容簡介
小工具通常使用 dynamic_sidebar() 函數作為側邊欄的一部分顯示。
靜態小工具有 the_widget 函數,但在外觀 > 小工具區域配置的特定小工具並沒有相對應的函數。
Widget Instance 外掛可讓所有能力的 WordPress 使用者顯示這些小工具,而不限於它們被指定的側邊欄。
功能
一個所選可用小工具的所見即所得編輯器按鈕
一個短碼 [widget_instance id=”[widget_id]”]
主題動作 do_action(‘widget_instance’, [widget_id])
開發人員的實用函數 get_widget_instance 和 widget_instance
用法
[widget_instance id=”[widget_id]”]
do_action(‘widget_instance’, ‘[widget_id]’);
the_widget_instance(‘[widget_id]’);
get_the_widget_instance(‘[widget_id]’);
外掛標籤
開發者團隊
原文外掛簡介
Widgets are normally displayed as part of a sidebar using the dynamic_sidebar()
function. There is the_widget function for static widgets, but there is no
equivalent for specific widgets configured in the Appearance > Widgets area.
The Widget Instance plugin allows WordPress users of all abilities to display
these widgets outside of the sidebars they have been assigned to.
Features
A wysiwyg editor button for selecting available widgets,
A shortcode [widget_instance id=”[widget_id]”],
A theme action do_action(‘widget_instance’, [widget_id]) and finally
Utility functions for developers get_widget_instance and widget_instance
Usage
[widget_instance id=”[widget_id]”]
do_action(‘widget_instance’, ‘[widget_id]’);
the_widget_instance(‘[widget_id]’);
get_the_widget_instance(‘[widget_id]’);
