[WordPress] 外掛分享: Customize Comments

首頁外掛目錄 › Customize Comments
全新外掛
安裝啟用
尚無評分
3033 天前
最後更新
問題解決
WordPress 4.9+ PHP 5.4+ v0.1.0 上架:2017-11-26

內容簡介

這個外掛是為了展示如何在 Customizer 中新增修改評論的功能而開發的。評論的修改會和 Customizer 彩色方案(customization session) 中的其他修改一起儲存在變更集中。它通過 REST API 實現了可擴展的「惰性加載控制/設定」功能。它示範了動態設定和動態局部。

它新增了一個「評論」區域到 Customizer,當擴展此區域時,文章最新的評論會被從 REST API 中擷取並加到此區域中,作為 textarea 控制項。區域底部會出現一個按鈕以載入後續評論頁面。

評論會被列出,並附帶評論者和評論發布日期,以及所評論的文章。目前僅評論內容可編輯。當您編輯預覽中出現的評論時,該評論將在低精度瞬時預覽後被預覽刷新。

當您進入文章並查看評論列表時,點擊 Customizer 預覽中的「編輯評論(Edit Comment)」連結,會導致評論被載入到此區域的新 textarea 控制項中,並且該控制項會擁有編輯焦點。

這是「Customize Posts」功能外掛的自然夥伴。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.0) 或搜尋安裝

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

原文外掛簡介

This plugin is a proof of concept for how comment editing might be added to the Customizer, with edits to comments being staged in changesets along with any other changes made in customziation session. It demonstrates scalable lazy-loading of controls/settings via the REST API. It demonstrates both dynamic settings and dynamic partials.
A new Comments section is added to the Customizer, and when this section is expanded the most recent comments are fetched from the REST API and then are added as textarea controls in the section. A button appears at the bottom of the section for loading subsequent pages of comments.
The comments are listed with the comment author and publish date along with the post it was commented on. Only the comment’s content is currently editable. When you do edit a comment that appears in the preview, then the comment will be previewed with selective refresh after a low-fidelity instant preview.
When you navigate to a post and see the comment list, clicking the “Edit Comment” link in the Customizer preview will cause the comment to be loaded into a new textarea control in the section, and the control will then be focused for editing.

This is a natural companion to the Customize Posts feature plugin.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon