
前言介紹
- 這款 WordPress 外掛「Sewn In Notifications」是 2015-06-12 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2015-06-13,距離現在已有 3911 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.6.1 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
Frontend | messages | front end | applications | Notifications |
內容簡介
一個用於 WordPress 的外掛程式,可在應用程式的前端上方創建可插入框架,以新增訊息通知。通知可以透過查詢變數或透過模板函數和動作生成。
此外掛程式可用於創建全站通知,或您可以縮小範圍以鎖定特定頁面。
將通知中心添加到您的模板中
添加通知的最基本方式是全站式的。您可以向模板添加 “show” 動作,例如 header.php 文件。這是該外掛程式的最強大用途:統一、集中的通知。
<?php do_action( 'sewn/notifications/show' ); ?>
創建查詢變數通知
擴展通知中心的最簡單方法是添加查詢變數鍵/值對,以在提交 URL 查詢變數時生成新訊息。
<?php
add_filter( 'sewn/notifications/queries', 'custom_add_query_notifications' );
function custom_add_query_notifications( $queries )
{
$queries[] = array(
'key' => 'update',
'value' => 'true',
'message' => "已更新。",
'args' => 'fade=true'
);
$queries[] = array(
'key' => 'update',
'value' => 'failed',
'message' => "無法更新。",
'args' => 'dismiss=true&error=true'
);
$queries[] = array(
'key' => 'update',
'value' => 'finished',
'message' => "完成!",
'args' => 'fade=10000' // 等待十秒後淡出
);
return $queries;
}
?>
現在,每當在頁面末端添加查詢變數時,都可以在通知中心中顯示一則訊息。
例如,http://example.com/path/to/page/?update=true 會在通知中心中生成訊息:“已更新。”
訊息引數
在添加訊息時,您可以使用引數來自訂功能。
error 當設定為 true 時,這將向訊息添加錯誤類別。預設值:false
fade 當設定為 true 時,這將在 3 秒後淡出訊息。您可以通過將 fade 設置為數字(以毫秒為單位)來更改暫停時間。預設值:false
dismiss 允許用戶使用關閉按鈕關閉訊息。預設值:false
event 允許訊息持久存在,因此每次頁面載入時都會出現,除非被解除。事件追蹤訊息,並在用戶關閉訊息時更新用戶 meta,因此將停止顯示訊息。預設值:false
page 僅鎖定訊息到特定頁面。設置 page 時,在顯示訊息之前,將執行 is_page($page) 檢查。尤其適用於設置查詢變數對時。預設值:false
手動生成通知
可以在 show 動作之前的任何地方手動添加通知。
if ( $something_happened ) :
do_action( 'sewn/notifications/add', $message, $args );
endif;
原文外掛簡介
A plugin for WordPress that creates a very pluggable framework to add notifications on the front end of your application. Notifications can be generated by query variables or through template functions and actions.
This plugin can be used to create site wide notifications, or you can narrow it down to specific pages.
Add the Notification Center to Your Template(s)
The most basic way to add notifications is sitewide. You can add the “show” action to a template like your header.php file. This is the most powerful use for the plugin: uniform, centralized notifications.
Create Query Variable Notifications
The simplest way to extend the notification center is to add query variable key/value pairs to generate a new message when url query variables are submitted.
'update',
'value' => 'true',
'message' => "Updated.",
'args' => 'fade=true'
);
$queries[] = array(
'key' => 'update',
'value' => 'failed',
'message' => "Unable to update.",
'args' => 'dismiss=true&error=true'
);
$queries[] = array(
'key' => 'update',
'value' => 'finished',
'message' => "Finished!",
'args' => 'fade=10000' // wait ten seconds before fading
);
return $queries;
}
?>
Now whenever a query variable is added to the end of a page, a message can be shown in the notification center.
So http://example.com/path/to/page/?update=true will generate the message: “Updated.” in the notification center.
Arguments for Messages
When adding a message, there are arguments you can use to customize the functionality.
error When set to true, this will add the error class to the message. Default: false
fade When set to true, this will fade the message out after 3 seconds. You can change the pause time by setting fade to a number (in milliseconds). Default: false
dismiss Allows a message to be dismissed by the user with a close button. Default: false
event Allows message to be persistent, so that it shows up on each page load unless dismissed. The event tracks the message and updates the user’s meta when the message is dismissed, so it will stop showing up. Default: false
page Lock a message to a specific page only. When page is set, a is_page($page) check will be performed before showing the message. Particularly useful when setting up query variable pairs. Default: false
Maually Generate Notifications
Add notifications manually anywhere before the show action.
if ( $something_happened ) :
do_action( 'sewn/notifications/add', $message, $args );
endif;
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Sewn In Notifications」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
HivePress Messages 》HivePress Messages 是一個擴充功能,適用於 HivePress 外掛程式。使用此外掛,使用者可以傳送私人訊息。, 示範 | 文件 | 支援。
WPC Smart Messages for WooCommerce 》tc., Product or service updates, changes or discontinuations, Site maintenance, upgrades or downtime notices, Important policy updates or terms and...。
Contact Form 7 Translate Messages Extension 》翻譯默認的 Contact Form 7 訊息,而不更改 WordPress 網站語言設定。, 支援的默認語言:, AR、BEL、BG、CA、CS、DA、DE、EL、EN-AU、EN-CA、EN-GB、EN-NZ、E...。
BuddyPress Default Data 》該外掛會創建大量用戶、消息、好友聯繫、群組、主題、活動項目和個人資料-可用於測試目的。, 所有導入的用戶都將擁有由 8biticon.com 生成並由 Gravatar 顯示...。
Site Announcements 》Site Announcements 可讓你向訪客廣播全站性的消息,並設置消息的自定義參數,例如背景和文字顏色,以及用户隱藏公告應該隱藏多久等。, 默認情況下,公告將在...。
BuddyPress Message Attachment 》這個 WordPress 外掛可擴充 BuddyPress 的私人訊息功能,允許使用者搭配附件傳送私人訊息。系統管理員可以控制允許附件的檔案類型和附件的最大大小。。BP Messages Tool 》BP Messages Tool 是用於 BuddyPress 或 BuddyBoss 平台的外掛。, 預設情況下,沒有人可以閱讀 BuddyPress 的私人訊息,除非它是由當前登入的會員發送或收到...。
Better Messages – WCFM Integration 》Better Messages 外掛與 WCFM 外掛整合。, 允許使用私人訊息系統連接賣家和買家。, 。
bbPress Messages 》bbPress Messages - 簡單但強大的私人信息系統,專為bbPress設計。, 2.0版新功能是什麼?, 完全優化, 現在,由於優化和信息緩存,bbPress Messages加載速度更...。
Cart & Checkout Notices/Messages for WooCommerce 》Cart Messages for WooCommerce 外掛可讓您在 WooCommerce 中添加和自定義購物車和結帳頁面的提示訊息。, ✅ 主要功能, , 添加自定義提示訊息至購物車頁...。Better Messages – Integration for WC Vendors Marketplace 》。
Advanced Notifications 》Advanced Notifications 允許您建立漂亮的自定義通知,顯示在您選擇的頁面或文章上。, Demo – Advanced Notifications – 在線預覽, 正在開發中:...。
BuddyPress Messaging Control 》這個外掛程式非常適合您若想要利用訊息來區別或營利您的BP網站。同時,它也可以控制內部垃圾郵件。您可以控制對訊息的存取權限以及使用者可以消息哪些其他使...。
BuddyPress Restrict Messages 》這個外掛非常適合用來防止私人訊息的垃圾郵件。它允許網站管理員和使用者自行決定誰可以對使用者發送訊息。, 這個外掛會建立一個名為 Restrict Messages 的管...。
WordPress Notice 》WP Notice 外掛可讓每個管理員根據標籤、分類或日期在帖子中發佈動畫公告或訊息。, 您可以為多個帖子指定多個訊息。基於 Bootstrap 樣式,還有幾種自定義設計...。
