[WordPress] 外掛分享: Hide Comments Feature

首頁外掛目錄 › Hide Comments Feature
WordPress 外掛 Hide Comments Feature 的封面圖片
1,000+
安裝啟用
★★★★
4.5/5 分(6 則評價)
3032 天前
最後更新
問題解決
WordPress 3.4+ v0.4 上架:2010-11-28

內容簡介

這個外掛是為那些不需要在 WordPress 中使用評論功能(有很多原因)的人所設計,它能在後臺和前端中刪除所有與評論相關的東西。
你的主題必須正確地使用 WordPress API 才能在前端支援。標籤<?php comment_form(); ?> 必須存在。
完全通過基於行動掛鉤和 CSS 的技術實現。

不需要任何配置,只需安裝即可刪除所有評論。

注意:這不會與核心產生衝突,因此您可以毫不費力地更新插件和 WordPress。

提供的自定義掛鉤

此外掛提供了 4 個自定義掛鉤,如果您需要主題中更多的內容,可以使用這些掛鉤。

add_action( 'hide_comments_post_types', 'my_hide_comments_post_types' ); 用於更改要由插件處理的文章類型列表。評論將從所有列出的文章類型中刪除。
add_action( 'hide_comments_css', 'my_hide_comments_css' ); 用於添加任意 CSS 以從您的主題中隱藏評論部分。
add_action( 'hide_comments_template_comments_path', 'my_hide_comments_template_comments_path' ); 默認路徑是此插件所在目錄中的空文件template-comments.php。如果要返回其他內容,請修改路徑以使用您自己的文件。
add_action( 'hide_comments_dashboard_right_now', 'my_hide_comments_dashboard_right_now' ); 如果返回 true,則會隱藏儀表板現在正進行的討論表。否則返回 false。默認值為 true。

建議使用這些掛鉤,這樣如果插件被停用,這些掛鉤將不再起作用,可以使您的環境保持一致和乾淨。

想要將其翻譯為您的語言嗎?只需回覆論壇中的“Translations”主題即可。

外掛標籤

開發者團隊

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

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

原文外掛簡介

For those who do not need to have the Comments feature in WordPress (there are a lot of reasons), this plugin removes any trace of that existence in both wp-admin and front-end.
Your theme must rely properly on the WordPress API for the front-end support. The tag must be present.
Completely done through techniques based on both action hooks and CSS.
Doesn’t requires any configuration, just install and any trace of Comments will disappear.
NOTE: This does NOT play with the core, so you are able to update both plugins and WordPress without any trouble.
Provided Custom Hooks
This plugin provides 4 custom hooks you may play if you need more substance in your theme.
add_action( 'hide_comments_post_types', 'my_hide_comments_post_types' ); to change the list of post types to be processed by the plugin. Comments will be removed from all listed post types.
add_action( 'hide_comments_css', 'my_hide_comments_css' ); to add arbitrary CSS to hide comment's stuff from your theme.
add_action( 'hide_comments_template_comments_path', 'my_hide_comments_template_comments_path' ); the default path is the empty file template-comments.php located in the same dir of this plugin. Just modify the path to your own file if you want to return anything else.
add_action( 'hide_comments_dashboard_right_now', 'my_hide_comments_dashboard_right_now' ); if true is returned, the discussion table of dashboard right now widget will be hidden. False otherwise. Defaults to true.

The use of these hooks are recommended, thus, if the plugin gets deactivated, those hooks will not be called anymore and then you get things consistent and clean.
Do you want to translate it to your language? Just reply to the «Translations» topic in the forum.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon