前言介紹
- 這款 WordPress 外掛「Trigger Browsersync」是 2017-04-06 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2022-06-23,距離現在已有 1045 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
- 有 3 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
dev | refresh | automation | browsersync |
內容簡介
將WordPress和Browsersync整合,當您編輯頁面時觸發重新載入等事件。
目前該插件僅觸發重新加載功能。如果您有其他功能的需求或想法,請聯繫我們。
由於您(應該)在生產網站上禁用此插件,因此WordPress統計數據將不可靠。如果您發現該插件有用,我們真的很感謝您通過快速電子郵件或消息讓我們知道!
觸發器
默認情況下,該插件會在以下操作上觸發重新載入:
save_post-編輯文章、頁面、自定義文章等
added_option-更改設置
attachment_updated-編輯媒體字段(標題等)
updated_postmeta-涵蓋許多事項,特別是重新生成媒體縮略圖。一些meta_fields被忽略(參見trigger_browsersync_irrelevant_meta_keys)
activated_plugin
deactivated_plugin
delete_widget
您可以使用過濾器自定義此及其他Browsersync設置:
add_filter('trigger_browsersync_reload_actions', function($filters) {
//刪除默認值。請記住,您採取的一個操作(例如保存頁面)可能觸發多個鉤子。
unset($filters['save_post']);
//添加自己的濾波器。鍵名允許其他過濾器刪除它(如上面的行)
$filters['wp_logout'] = 'wp_logout';
return $filters;
});
忽略Meta Key
並非所有的meta_key更新(由updated_postmeta觸發)對您站點的前端功能都有影響。您可以使用trigger_browsersync_irrelevant_meta_keys過濾器自定義要忽略的meta_key值:
add_filter('trigger_browsersync_irrelevant_meta_keys', function($filters) {
// 刪除默認值。
unset($filters['_edit_lock']);
//添加你自己的。鍵名允許其他過濾器刪除它(如上面的行)
$filters['_edit_lock'] = '_edit_lock';
return $filters;
});
使用過濾器進行配置
將使用默認的Browsersync設置(http://localhost:3000),但您可以使用過濾器進行更改。過濾器每次激活觸發器時都會使用,因此您不需要在實例化類之前設置它們。
add_filter('trigger_browsersync_protocol', function(){ return 'https'; } );
add_filter('trigger_browsersync_host', function(){ return 'dev.server'; } );
add_filter('trigger_browsersync_port', function(){ return '4321'; } );
或者,您可以指定整個URL,這樣其他URL就會被忽略,但請勿包含尾隨斜杠。
add_filter('trigger_browsersync_url', function(){ return 'http://localhost:3000'; } );
環境配置
由於您可能只想要在開發或測試站點上使用Browsersync,因此一旦您在WordPress中啟用它,插件就不會起作用。
要使其工作,您需要創建一個檔案來啟用它。詳情請參閱安裝說明。
記錄活動
Trigger Browsersync可以將事件記錄到WordPress日誌中-這對於插件的開發尤其有用,當您想添加或排除新事件以觸發操作時。
要啟用記錄,請在您的enable-trigger-browsersync.php文件中添加此過濾器(請參閱安裝);
add_filter('trigger_browsersync_log_events', '__return_true');
原文外掛簡介
Integrates WordPress with Browsersync to trigger events like reload when you edit pages.
The plugin also only triggers a reload for now. If you have requests or ideas for other functionality, get in touch.
Since you (should) disable this plugin on production sites, the WordPress stats won’t be reliable – if you find the plugin useful I’d really appreciate it if you’d let me know with a quick email or message!
Triggers
By default the plugin will trigger a reload on these actions:
save_post – Editing posts/pages/custom posts etc
added_option – Changing settings
attachment_updated – Editing media fields (caption etc)
updated_postmeta – Covers many things, particularly regenerating media thumbnails. Some meta_fields are ignored (see trigger_browsersync_irrelevant_meta_keys)
activated_plugin
deactivated_plugin
delete_widget
you can customise this as well as other Browsersync settings using filters:
add_filter('trigger_browsersync_reload_actions', function($filters) {
// Remove a default. Bear in mind that one action you take (e.g. saving a page)
// may trigger more than one hook.
unset($filters['save_post']);
// Add your own. The key name lets other filters remove it (like the line above)
$filters['wp_logout'] = 'wp_logout';
return $filters;
});
Ignoring Meta Keys
Not all meta_key updates (triggered by updated_postmeta) have any impact on the front-end functioning of your site. You can customise which meta_key values are ignored with the trigger_browsersync_irrelevant_meta_keys filter:
add_filter('trigger_browsersync_irrelevant_meta_keys', function($filters) {
// Remove a default.
unset($filters['_edit_lock']);
// Add your own. The key name lets other filters remove it (like the line above)
$filters['_edit_lock'] = '_edit_lock';
return $filters;
});
Configuration with Filters
The default Browsersync settings will be used (http://localhost:3000) but you can use filters to change them. The filters are used every time the trigger is activated so you don’t need to set them before instanciating the class.
add_filter('trigger_browsersync_protocol', function(){ return 'https'; } );
add_filter('trigger_browsersync_host', function(){ return 'dev.server'; } );
add_filter('trigger_browsersync_port', function(){ return '4321'; } );
Or you can specify the whole URL which will cause the others to be ignored, but don’t include a trailing slash.
add_filter('trigger_browsersync_url', function(){ return 'http://localhost:3000'; } );
Environmental Configuration
Since you probably only want Browsersync on your development or staging site, the plugin will do nothing once you activate it it in WordPress.
To make it work, you’ll want to create a file to activate it. See Installation for instructions.
Logging Activity
Trigger Browsersync can log events to the WordPress log – this is especially useful for development on the plugin when you want to add or exclude a new event from triggering an action.
To enable logging add this filter to your enable-trigger-browsersync.php file (see Installation);
add_filter('trigger_browsersync_log_events', '__return_true');
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Trigger Browsersync」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
OttoKit: All-in-One Automation Platform (Formerly SureTriggers) 》ther popular tools. It is affordable and easy to use, even for non-technical users., With SureTriggers, you can create complex workflows and integr...。
Uncanny Automator – Easy Automation, Integration, Webhooks & Workflow Builder Plugin 》Uncanny Automator 是一個無需編程最簡單且最強大的自動化 WordPress 外掛。使用數十億種配方組合,能在幾分鐘內建立自動化連接 WordPress 插件、網站和應用...。
NextScripts: Social Networks Auto-Poster 》此外掛可自動將您部落格的文章發佈到社交媒體帳號,例如 Twitter、Blogger、Telegram、Tumblr、Flickr、LinkedIn、ok.ru、LiveJournal、DreamWidth、Flipboar...。
MailerLite – WooCommerce integration 》歡迎使用官方 MailerLite 整合 WooCommerce 的外掛程式。MailerLite 是一個電子郵件行銷工具,讓您輕鬆設計美麗的電子報,並建立自動化的電子商務電子郵件行...。
Brevo for WooCommerce 》Sendinblue的WooCommerce外掛是將您的商店整合並發送更好的通訊的最簡單方式。, , 受到全球400,000家企業的信賴,Sendinblue是一個全能的行銷平台,通過有針...。
Webhook Automator & Contact Form Integration to Automate 280+ Platforms – Bit Integrations 》Bit Integrations 是一款在 WooCommerce、網頁建構器、表單建構器、CRM、LMS、預約系統、試算表、銷售漏斗、Webhooks、社交媒體和電子郵件行銷等領域自動化各...。
WP Webhooks – Automate repetitive tasks by creating powerful automation workflows directly within WordPress 》ete post, Trigger: Send data on comment creation, update and deletion, , Overall, WP Webhooks is a versatile and powerful plugin that can bring you...。
Thrive Automator 》, Thrive Automator 是一款免費的外掛,它可以讓您連接您最喜愛的工具與 WordPress 網站,並創建強大的自動化。, 探索官方的 Thrive Automator 頁面, 您是否...。
Ray Enterprise Translation 》Ray Enterprise Translation 提供方便的基於雲端的本地化和WordPress翻譯,通過簡化創建和維護多語言網站的過程。其功能包括機器翻譯、專業翻譯和社區翻譯解...。
ACF Theme Code for Advanced Custom Fields 》ACF Theme Code 外掛可以自動生成在主題中實現 Advanced Custom Fields 所需的程式碼。以下是該外掛的功能特色:, , - 縮短網站開發時間。, - 當您發布、編輯...。
AI Chatbot for WordPress – Hyve Lite 》總結:Hyve Lite 是一個AI驅動的WordPress外掛程式,將您的網站內容轉換為互動對話。它利用您的文章和頁面作為知識庫,實現動態用戶互動。輕鬆從WordPress儀...。
AutomatorWP – Automator plugin for no-code automations, webhooks & custom integrations in WordPress 》AutomatorWP是一個靈活和開源的自動化外掛程式,可讓您連接 WordPress 外掛程式並建立自動化工作流程。, , 您可以建立與 WordPress 活動相關聯的「自動化」,...。
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 》ck-through rate (CTR), unsubscribe rate, User activity : clicks, opens, bounces, unsubscribes, complaints, , AcyMailing is the perfect solution for...。
WP Mautic 》Mautic WordPress 外掛會在 WP 網站中注入 Mautic 追蹤腳本和圖片。您的 Mautic 實例可以追蹤有關訪問者的信息。您也可以使用不同的短碼在您的網站中插入 Mau...。
LinkBoss – Semantic Internal Linking 》### 摘要:, LinkBoss (智慧型最佳內部鏈結工具) 是一款設計用來自動化並優化內部鏈結策略的最智慧鏈結工具。藉由輕鬆地創建有意義且與內容相關的內部鏈結,來...。