[WordPress] 外掛分享: Stealth Publish

首頁外掛目錄 › Stealth Publish
WordPress 外掛 Stealth Publish 的封面圖片
900+
安裝啟用
★★★★★
5/5 分(11 則評價)
3624 天前
最後更新
問題解決
WordPress 3.6+ v2.6 上架:2010-09-08

內容簡介

此外掛能夠防止特定文章出現在首頁或任何 feeds 中,也可以阻止任何外部服務發送新文章時的通知。在想要即時發佈內容,但不希望轟動宣揚,並且僅將文章添加到儲存庫和分類頁面及其永久網址頁面時,這會非常有用。

在「編輯文章」後台頁面,新增了一個「隱密發佈?」的勾選框。勾選裡面的文章將不會再出現在首頁或 feeds 中。

隱密發表的文章也不會通知任何外部服務有新文章出現。這包括不發送 pingback、trackback,以及不更新像 pingomatic.com 這樣的服務。可以透過 “c2c_stealth_publish_silent” 過濾器(請參閱過濾器部分)覆寫此行為。

注意事項:
- 僅需使用 WordPress 標準的檢索文章函式(主要文章查詢和最近文章小工具),而非其他插件對資料庫進行查詢,即可避免隱密發佈文章出現在首頁。
- 如果使用這個插件,則不需要使用「Silent Publish」插件,因為這個功能已經包含在此插件中。或者,如果您喜歡靜默發佈的功能,但想讓新文章出現在您的博客首頁和 feeds中,那麼只需使用「Silent Publish」插件即可。
- 該插件會記錄文章隱密發佈的時間,在日後編輯文章時,該「隱密發佈?」的勾選框會預設勾選。

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

過濾器:
這個插件還通過三個過濾器進行進一步的自定義。通常,這些自定義會放入您的活動主題的 functions.php 文件中,或由其他插件使用。

-c2c_stealth_publish_meta_key(過濾器)
-c2c_stealth_publish_silent(過濾器)

外掛標籤

開發者團隊

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

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

原文外掛簡介

This plugin allows you to prevent specified posts from being featured on the front page or in feeds, and from notifying external services of publication. Beneficial in instances where you want to publish new content without any fanfare and just want the post added to archive and category pages and its own permalink page.
A “Stealth publish?” checkbox is added to the “Write Post” admin page. Posts which are saved with that checkbox checked will no longer be featured on the front page of the blog, nor will the post be included in any feeds.
A stealth published post will also not notify any external services about the publication. This includes not sending out pingbacks, trackbacks, and pings to update services such as pingomatic.com. This behavior can be overridden via the ‘c2c_stealth_publish_silent’ filter (see Filters section).
NOTES:

Use of other plugins making their own queries against the database to find posts will possibly allow a post to appear on the front page. But use of the standard WordPress functions for retrieving posts (as done for the main posts query and the recent posts widget) should not allow stealth published posts to appear on the home page.

If you use this plugin, you do not need to use my Silent Publish plugin as that functionality is incorporated into this plugin. Alternatively, if you like the silent publishing feature but want your new posts to appear on your blog’s front page and in feeds, then just use the “Silent Publish” plugin.

The plugin records when a post is stealth published, so subsequent edits of the post will have the “Stealth publish?” checkbox checked by default.

Links: Plugin Homepage | Plugin Directory Page | Author Homepage
Filters
The plugin is further customizable via three filters. Typically, these customizations would be put into your active theme’s functions.php file, or used by another plugin.
c2c_stealth_publish_meta_key (filter)
The ‘c2c_stealth_publish_meta_key’ filter allows you to override the name of the custom field key used by the plugin to store a post’s stealth publish status. This isn’t a common need.
Arguments:

$custom_field_key (string): The custom field key to be used by the plugin. By default this is ‘_stealth-publish’.

Example:
/**
* Defines a custom meta key to be used by Stealth Publish.
*
* @param string $custom_field_key The default custom field key name.
* @return string
*/
function override_stealth_publish_key( $custom_field_key ) {
return '_my_custom_stealth-publish';
}
add_filter( 'c2c_stealth_publish_meta_key', 'override_stealth_publish_key' );

c2c_stealth_publish_silent (filter)
The ‘c2c_stealth_publish_silent’ filter allows you to override whether the plugin also ensure the post gets published silently (i.e. without sending out pingbacks, tracbacks, and pings to update services).
Arguments:

$publish_silently (bool): Should stealth published posts also be published silently? By default this is ‘true’.
$post_id (int): The ID of the post being published.

Example:
/**
* Disable silent publishing for stealth published posts.
*
* @param bool $publish_silently True if the post is to be published silently.
* @param int $post_id The post ID.
* @return Always false.
*/
function override_stealth_publish_silent( $publish_silently, $post_id ) {
return false;
}
add_filter( 'c2c_stealth_publish_silent', 'override_stealth_publish_silent' );

c2c_stealth_publish_default (filter)
The ‘c2c_stealth_publish_default’ filter allows you to override the default state of the ‘Stealth Publish?’ checkbox.
Arguments:

$state (boolean): The default state of the checkbox. By default this is false.
$post (WP_Post): The post currently being created/edited.

Example:
// Have the Stealth Publish? checkbox checked by default.
add_filter( 'c2c_stealth_publish_default', '__return_true' );

延伸相關外掛

文章
Filter
Mastodon