前言介紹
- 這款 WordPress 外掛「Sewn In Notifications」是 2015-06-12 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2015-06-13,距離現在已有 3613 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.6.1 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
Frontend | messages | front end | applications | Notifications |
內容簡介
一個用於 WordPress 的外掛程式,可在應用程式的前端上方創建可插入框架,以新增訊息通知。通知可以透過查詢變數或透過模板函數和動作生成。
此外掛程式可用於創建全站通知,或您可以縮小範圍以鎖定特定頁面。
將通知中心添加到您的模板中
添加通知的最基本方式是全站式的。您可以向模板添加 “show” 動作,例如 header.php 文件。這是該外掛程式的最強大用途:統一、集中的通知。
創建查詢變數通知
擴展通知中心的最簡單方法是添加查詢變數鍵/值對,以在提交 URL 查詢變數時生成新訊息。
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 環境。
延伸相關外掛(你可能也想知道)
Prevent Browser Caching 》您是一位前端開發人員嗎?想要清除所有使用者的瀏覽器快取嗎?只需啟用此外掛程式並展現您的作品!, Prevent Browser Caching 外掛程式可讓您自動或手動一鍵...。
My WP Customize Admin/Frontend 》這個外掛讓管理者和前端使用者都能輕鬆地進行自訂設定。許多自訂篩選器和操作,還包含開發者工具。, 示範網站在這裡:https://tastewp.com/new/?pre-installe...。
UsersWP – ReCaptcha 》UsersWP 的 ReCaptcha 外掛程式。, UsersWP ReCaptcha 外掛允許您將高級安全性驗證碼 (captcha) 嵌入表格,如註冊、登入表單中。, 使用 UsersWP Re-Captcha ...。
Social Articles 》使用 Social Articles 您可以從您的 BuddyPress 個人資料建立文章,附加精選圖片、設置類別和標籤等等!, 它支援所有 BuddyPress 主題,因此您不必成為專家就...。
Hide Title 》這個外掛允許管理員在單頁或文章上隱藏標題標籤。。
Frontier Post 》WordPress Frontier Post 插件可讓所有使用者角色在前端輕鬆地管理標準文章。, Frontier Post 插件的目的是為您的部落格啟用前端發布和編輯功能,讓您的用戶...。
Frontend Checklist 》中文:, 使用 Frontend Checklist,你可以為你的訪客創建 HTML 或 PDF 檢查清單。 HTML 檢查清單的狀態可以通過 Cookie 或數據庫保存。你的訪客可以隨時回來...。
Archive Posts Sort Customize 》本外掛可輕鬆設置首頁、日期文章存檔、分類/標籤/分類法文章存檔和搜尋區的介面和可用排序。, 排序項目, , 文章日期, 文章標題, 文章作者, 文章評論數, 文章 ...。
Checklist 》將您網誌上的任何列表轉換成美觀的互動檢查清單。列印、使用、分享、下載到行動裝置等等,全部百分百免費。, 人們喜歡清單!如果您經營一個成功的部落格,您...。
Tailor Page Builder 》Tailor 是一個為 WordPress 設計的免費前端頁面建構器,具備簡單直覺的拖放介面。, , , 請查看 Advanced Features 擴充套件 以了解新的元素和特色。與 Tailor...。
Media Playback Speed 》這個簡短、實用的外掛程式會為使用 mediaelement.js 內建 WordPress 短碼所加入的音訊、影片和播放清單元素添加播放按鈕。, 每組按鈕都針對頁面上的相應元素...。
Gravity Forms: Post Updates 》需要 PHP 5.3 或更高版本, 允許您在前端使用 Gravity Forms 更新任何文章。如果使用 "Gravity Forms + Custom Post Type" 外掛,甚至可以更新自定義文章類型...。
Forge – Front-End Page Builder 》WordPress Page Builder Plugin, 製作精彩內容不應該困難。這就是為什麼我們創造了Forge,一個前端頁面建構器,讓您可以輕鬆地創建令人驚嘆的網站。, Forge讓...。
Disable Version Caching – Khanakia 》你是一位前端開發者嗎?你想為所有使用者清除瀏覽器快取嗎?只需啟用這個外掛就可以!, Disable Version Caching 可以自動或手動一鍵更新所有 CSS 和 JS 檔案...。
DJD Site Post 》此外掛可在網站中添加(響應式)表單以撰寫文章,而不需要進入管理區。它允許使用「匿名」或「訪客」發布(未登錄用戶)。這使得 DJD Site Post 成為用戶生成...。