[WordPress] 外掛分享: One Click Close Comments

首頁外掛目錄 › One Click Close Comments
WordPress 外掛 One Click Close Comments 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10,000+
安裝啟用
★★★★
4.9/5 分(10 則評價)
1810 天前
最後更新
問題解決
WordPress 4.7+ v2.7.1 上架:2009-06-11

內容簡介

使用者可以從文章管理頁面(‘編輯文章’)及頁面管理頁面(‘編輯頁面’)中,對於他們有足夠權限進行更改的文章關閉或開啟評論(基本上是管理員和文章作者針對自己的文章)。這是透過 AJAX 加強與一個色彩編碼的指示器完成。色彩編碼提供文章評論當前狀態的即時反饋:綠色表示文章/頁面開放評論,紅色表示文章/頁面關閉評論。透過 AJAX 加強意味著更改在點擊後會在背景中提交,而不需要重新載入整個頁面。

此外掛僅可供開啟 JavaScript 的管理員使用於管理頁面。

連結: 插件首頁 | 插件目錄頁 | GitHub | 作者首頁

Hooks

此外掛公開了一個可連結的過濾器。相關的程式碼最好放在 mu-plugin 或特定網站掛件內(超出此說明文件的範疇)。

c2c_one_click_close_comments_click_char (filter)

‘c2c_one_click_close_comments_click_char’ 串鉤讓您可以使用替代的字元、字串或標記作為掛件在文章列表表格中的指示元素。這是會進行色彩編碼的狀態,且需要點擊切換評論的開放狀態。您可以使用 Dashicons 指定所需的 Dashicon 名稱(使用「dashicons-」前綴)。預設使用評論 Dashicon dashicons-管理員評論。

參數:

$char (array): 要顯示的字元、字串或標記(預設為 dashicons-admin-comments)。

範例:

/**
* 將用於一鍵連結的字元更改為一個圓點(實心圓)。
*
* @param string $char 預設字元。
* @return string
*/
function custom_one_click_char( $char ) {
return '•';
}
add_filter( 'c2c_one_click_close_comments_click_char', 'custom_one_click_char' );

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.7.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「One Click Close Comments」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

From the admin listing of posts (‘Edit Posts’) and pages (‘Edit Pages’), a user can close or open comments to any posts to which they have sufficient privileges to make such changes (essentially admins and post authors for their own posts). This is done via an AJAX-powered color-coded indicator. The color-coding gives instant feedback on the current status of the post for comments: green means the post/page is open to comments, red means the post/page is closed to comments. Being AJAX-powered means that the change is submitted in the background after being clicked without requiring a page reload.
This plugin will only function for administrative users in the admin who have JavaScript enabled.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Hooks
The plugin exposes one filter for hooking. Such code should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).
c2c_one_click_close_comments_click_char (filter)
The ‘c2c_one_click_close_comments_click_char’ hook allows you to use an alternative character, string, or markup as the plugin’s indicator in the posts listing tables. It is the character that gets color-coded to indicate if comments are open or close, and the thing to click to toggle the comment open status. You can make use of Dashicons by specifying the desired dashicon’s name (with the “dashicons-” prefix). By default this is the comments dashicon, dashicons-admin-comments.
Arguments:

$char (array): The character, string, or markup to be used for display (by default this is dashicons-admin-comments).

Example:
/**
* Changes the character used as the one-click link to a bullet (solid circle).
*
* @param string $char The default character.
* @return string
*/
function custom_one_click_char( $char ) {
return '•';
}
add_filter( 'c2c_one_click_close_comments_click_char', 'custom_one_click_char' );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon