前言介紹
- 這款 WordPress 外掛「Duplicate Widget」是 2011-12-11 上架。
- 目前有 1000 個安裝啟用數。
- 上一次更新是 2017-11-28,距離現在已有 3011 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.1 以上版本才可以安裝。
- 有 12 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
widget | sidebar | widgets | duplicate | coffee2code |
內容簡介
r />
一個小工具,可以作為另一個小工具的副本(用於在另一個側邊欄中同步使用)
只需定義一次小工具,即可在多個側邊欄中使用。這樣可以避免手動配置每個小工具的麻煩,並且在以後需要進行任何更改時,也可以省去保持它們同步的煩惱。特別適用於在其主題中定義邏輯以有條件地包含不同版本的側邊欄的人。根據使用情況,這是應用於決定何時顯示小工具的小工具邏輯的替代方案(Widget Logic、Section Widget、條件小工具等)。
此外,快速概述此插件的功能:
添加一個名為“Duplicate”的小工具。小工具的唯一設置是下拉菜單,其中列出所有活動小工具。所選小工具將是副本小工具要複製的小工具。
副本小工具顯示的標題和內容與其源小工具相同,即使這些值稍後在源小工具中更改。
可以將小工具複製任意次數,在同一頁面中可以出現多次(是的,即使在同一個側邊欄中,為什麼要這樣做呢?)
副本小工具將遵循其放置的側邊欄的配置,而不是源小工具的側邊欄的配置。因此,副本小工具使用自己側邊欄的“before_widget”、“after_widget”、“before_title”、和“ after_title”值。
複製的小工具在管理員小工具標題欄中的名稱中預置“[D]”,以表示它們有副本。此外,在展開小工具並向下滾動時,也會在小工具的配置表單底部顯示一個簡短的説明,該説明說明小工具有幾個副本。
如果某個小工具被停用或刪除,如果它有任何副本,這些副本也會被刪除。
在複製小工具的標記中包含源小工具的小工具ID和小工具類型。
鏈接:插件主頁面 | 插件目錄頁面 | 作者主頁面
篩選器
該插件公開了四個操作以進行鉤取。定制利用這些鉤子的通常放在您正在使用的主題的 functions.php 文件中,或被其他插件使用。
c2c_before_duplicate_widget(動作)
“c2c_before_duplicate_widget”鉤子允許你在副本小工具輸出之前輸出文本或執行某些操作。
參數:
$ instance(array):小工具實例的設置(即:標題和widget_to_duplicate)
$ args(array):小工具和側邊欄的配置
示例:
//在複製小工具內容前輸出開始的 <div>
add_action(‘c2c_before_duplicate_widget’,‘my_c2c_before_duplicate_widget’,10,2);
function my_c2c_before_duplicate_widget($ instance,$ args){
echo ‘<div class =“a_duplicate_widget”>;
}。
c2c_after_duplicate_widget(動作)
“c2c_after_duplicate_widget”鉤子允許你在副本小工具輸出之後輸出文本或執行某些操作。
參數:
$ instance(array):小工具實例的設置(即:標題和widget_to_duplicate)
$ args(array):小工具和側邊欄的配置
原文外掛簡介
A widget that can act as a duplicate of another widget (for synchronized use in another sidebar)
Define a widget once, use it in multiple sidebars. This saves you from having to manually configure each copy of the widget and later having to worry about keeping them in sync should you ever need to make any changes. Particularly useful for those who define logic in their themes to conditionally include different versions of a sidebar depending on what template is being shown. Depending on use, it is an alternative to plugins that introduce in-widget logic to determine when widgets should be visible (Widget Logic, Section Widget, Conditional Widgets, etc).
Quick overview of what this plugin does:
Adds a widget called “Duplicate”. The widget’s only setting is a dropdown listing all active widgets. The selected widget will be the widget duplicated by the duplicate widget.
A duplicate widget shows the same title and content as its source widget, even if those values later get changed in the source widget.
A widget can be duplicated any number of times and can appear multiple times within the same page. (Yes, even within the same sidebar, though why would you do that?)
A duplicate widget will abide by the configuration of the sidebar it is placed in, not the configuration of the sidebar containing the source widget. So it uses ‘before_widget’, ‘after_widget’, ‘before_title’, ‘after_title’ values of its own sidebar.
Widgets that are duplicated will have “[D]” prepended to their name in the widget titlebar in the admin to denote they have duplicates. Also, at the bottom of the widget’s configuration form (when the widget is expanded), a short blurb also explains that the widget has duplicate(s) and a count of how many duplicates it has.
If a widget is deactivated or deleted, if it has any duplicates, they get deleted as well.
The widget id and widget type of the source widget are included as HTML classes in the duplicate widget’s markup.
Links: Plugin Homepage | Plugin Directory Page | Author Homepage
Filters
The plugin exposes four actions for hooking. Typically, customizations utilizing these hooks would be put into your active theme’s functions.php file, or used by another plugin.
c2c_before_duplicate_widget (action)
The ‘c2c_before_duplicate_widget’ hook allows you to output text, or perform some sort of action, just before the output of the duplicate widget.
Arguments:
$instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)
$args (array) : The configuration for the widget and sidebar
Example:
// Output an opening
add_action( 'c2c_before_duplicate_widget', 'my_c2c_before_duplicate_widget', 10, 2 );
function my_c2c_before_duplicate_widget( $instance, $args ) {
echo '
after duplicate widget content
add_action( 'c2c_after_duplicate_widget', 'my_c2c_after_duplicate_widget', 10, 2 );
function my_c2c_after_duplicate_widget( $instance, $args ) {
echo '
;
}
c2c_before_duplicate_widget_form (action)
The ‘c2c_before_duplicate_widget_form’ hook allows you to output text, or perform some sort of action, just before the output of the duplicate widget’s configuration form (in the WP admin).
Arguments:
$instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)
Example:
// Display a message just before the duplicate widget settings form
add_action( 'c2c_before_duplicate_widget_form', 'my_c2c_before_duplicate_widget_form' );
function my_c2c_before_duplicate_widget_form( $instance ) {
echo '
Note: this is a note above the widget settings form.
';
}
c2c_after_duplicate_widget_form (action)
The ‘c2c_after_duplicate_widget_form’ hook allows you to output text, or perform some sort of action, just after the output of the duplicate widget’s configuration form (in the WP admin).
Arguments:
$instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)
Example:
// Display a message just after the duplicate widget settings form
add_action( 'c2c_after_duplicate_widget_form', 'my_c2c_after_duplicate_widget_form' );
function my_c2c_after_duplicate_widget_form( $instance ) {
echo '
Note: this is a note below the widget settings form.
';
}
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Duplicate Widget」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
WPvivid — Backup, Migration & Staging 》oviders, such as Google Drive, Amazon S3, Dropbox, OneDrive, and FTP/SFTP., You can choose to send one-time backup or scheduled backup to the remot...。
Post Duplicator 》這個外掛是用來製作選定文章的完全一模一樣複製。它支援自訂文章類型、自訂分類和自訂欄位。, *注意: 評論不會被複製到新文章。, 這個外掛的目的是為了快速且...。
Custom Product Tabs for WooCommerce 》此外掛擴充了 WooCommerce 功能,允許商店擁有者針對產品添加自訂選項卡。這些選項卡顯示在每個產品頁面上,出現在預設的「描述」選項卡右側。, 個別產品選項...。Duplicate Menu 》一些 WordPress 安裝使用著核心菜單 (Menus) 驅動的複雜導航系統。它們是一個非常好的功能,常常能決定一個主題的成敗。但是,菜單在原生狀態下不太容易轉移...。
Clone 》在你的免費虛擬網站上試試看:點擊此處 => https://tastewp.com/plugins/wp-clone-by-wp-academy。, (這個技巧適用於 WP 庫中的所有外掛程式 —— 將 URL ...。
NS Cloner – Site Copier 》NS Cloner是目前最簡單、最快速、最易於使用的方式,讓您能夠在WordPress多站點網路上建立設定完整的網站。NS Cloner可以將任何現有的WordPress多站點網路上...。
Auto Coupons for WooCommerce 》這個簡單、快速且輕量級的外掛程式可以自動應用 WooCommerce 優惠券。 , 特色功能, , 當原生的 WooCommerce 優惠券條件符合時,自動套用優惠券, 當產品數量達...。
BCM Duplicate Menu 》現在您只需點擊一個按鈕就可以輕鬆地複製您的選單。, 此外掛程式也相容於 ClassicPress。。Menu Item Duplicator 》這個外掛讓你可以在「外觀」>「選單」中複製選單項目,包括子選單項目。。
Duplica – Duplicate Posts, Pages, Custom Posts or Users 》Duplica 可以讓您將文章、頁面或自定義文章複製到相同或不同的文章類型。, 文章的元資料和相關的分類也會被一併複製。, 支援的文章類型, , 文章 (Post), 頁面...。Advance Canonical URL 》此 WordPress 外掛提供高級設置,在整個網站中避免重複內容以符合 SEO 標準。。
ACF Flexible Layouts Manager 》更新, 我現在沒有時間積極地開發此外掛了。抱歉修補錯誤的進度有所延遲。, 我的朋友兼導師 @hwk 開發了外掛ACF Extended,那個外掛太讚了!, ACFE 整合了 AFL...。Broadcast 》輕鬆進行網站內容的網絡同步傳播!, 現在,在 WordPress 多站點網絡中,只需一個源頭,即可輕鬆地進行內容同步傳播!您可以將文章同步傳播到網絡中的其他博客...。
PW WooCommerce Copy Coupon 》PW WooCommerce Copy Coupon 外掛可為預設的 WooCommerce 優惠券頁面加上「複製」連結,讓您可以複製現有的優惠券。, , 欲了解更多功能,請參閱PW WooCommerc...。Post Cloner 》Post Cloner可以在文章/頁面編輯頁面上創建一個快速訪問操作按鈕,與“編輯”,“快速編輯”,“垃圾桶”和“查看”並排。, 所有克隆的文章、頁面和自定義文章類型將...。
