[WordPress] 外掛分享: Expandable Dashboard Recent Comments

首頁外掛目錄 › Expandable Dashboard Recent Comments
WordPress 外掛 Expandable Dashboard Recent Comments 的封面圖片
30+
安裝啟用
★★★★★
5/5 分(2 則評價)
331 天前
最後更新
問題解決
WordPress 4.6+ v3.0.1 上架:2009-06-10

內容簡介

預設情況下,在「活動」管理儀表板小工具的「評論」部分僅顯示評論的摘要,將評論內容截斷為前20個詞,同時去除所有標記。

這個外掛在評論操作列(當您將鼠標懸停在評論上時,許多變成可見的評論鏈接)末尾添加了一個連結。當點擊「顯示更多」鏈接時,將用完整的評論替換摘要。完整的評論將包括所有標記,包括原來使用的標記以及通過過濾器、插件等應用的更改(例如短碼展開、表情符號、段落等)。通過點擊「顯示更少」鏈接(當評論擴展時,替換「顯示更多」鏈接)可將完整評論切換回摘要。

「原地擴展」指的是點擊鏈接以查看完整評論,而不需要重新加載頁面或導航。

注意:此外掛僅適用於啟用JavaScript的用戶。

鏈接:外掛主頁 | 外掛目錄頁 | GitHub | 作者主頁

鉤子

此外掛為掛鉤暴露了一個過濾器。這樣的代碼理應放入mu外掛或特定網站的外掛中(這在此自述文件中超出範圍)。

c2c_expandable_dashboard_recent_comments_start_expanded(過濾器)

「c2c_expandable_dashboard_recent_comments_start_expanded」鉤子允許您配置「最近的評論」管理儀表板小工具,最初以其擴展狀態顯示所有評論(即未削減)。

參數:

$default(布爾值):預設狀態為「false」(因此評論最初被顯示為削減形式)
$comment(對象): 正在顯示的評論對象

範例:

// 最初完全展開儀表板評論
add_filter( 'c2c_expandable_dashboard_recent_comments_start_expanded', '__return_true' );

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.0.1) 或搜尋安裝

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

原文外掛簡介

By default, the ‘Comments’ section of the ‘Activity’ admin dashboard widget only shows an excerpt for the comments, truncating the content of the comments to the first 20 words while at the same time stripping out all markup.
This plugin adds a link at the end of the comment actions row (the links for the comment that become visible under the comment when you hover over the comment). The “Show more” link, when clicked, will replace the excerpt with the full comment. The full comment will include all markup, including originally utilized markup and changes applied via filters, plugins, etc (such as shortcode expansion, smilies, paragraphing, etc). The full comment can be switched back to the excerpt by clicking the “Show less” link (which replaces the “Show more” link when the comment is expanded).
“In-place expansion” refers to the ability to click the link to see the full comment and it will be presented in place of the excerpt without requiring a page reload or navigation.
NOTE: This plugin only works for users 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_expandable_dashboard_recent_comments_start_expanded (filter)
The ‘c2c_expandable_dashboard_recent_comments_start_expanded’ hook allows you to configure the ‘Recent Comments’ admin dashboard widget initially display all comments in their expanded state (i.e. not excerpted).
Arguments:

$default (boolean): The default state, which is ‘false’ (therefore comments are initially shown excerpted)
$comment (object) : The comment object being displayed

Example:
// Initially show dashboard comments fully expanded
add_filter( 'c2c_expandable_dashboard_recent_comments_start_expanded', '__return_true' );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon