[WordPress] 外掛分享: Stealth Update

WordPress 外掛 Stealth Update 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Stealth Update」是 2010-09-07 上架。
  • 目前有 100 個安裝啟用數。
  • 上一次更新是 2016-04-13,距離現在已有 3307 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.6 以上版本才可以安裝。
  • 有 5 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

coffee2code |

外掛標籤

post | latest | update | publish | post_modified |

內容簡介

此外掛允許您選擇在不更新文章的 post_modified 時戳的情況下進行文章更新。

WordPress 維護一個名為 post_modified 的文章欄位,用於追蹤文章上一次編輯的日期。此值用於訂閱以指示每篇文章的最新更新或報告最新更新的文章。插件和佈景主題也可能引用文章修改日期以引起對已更新文章的關注。但是,如果更新是您不希望在 post_modified 時戳中記錄的更改(也許是由於更新是小的格式/編輯更改或修正了錯別字,或者您只想保密更新),則使用此插件。

此插件為任何文章或頁面的「編輯文章」管理頁面的「發布」框中添加了一個「隱藏更新?」複選框。

請注意:插件紀錄文章何時被「隱藏更新?」,因此稍後編輯文章時,該複選框將默認選中。

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

過濾器

通過兩個篩選器,可以進一步自定義插件。通常,這些自定義將被放入您的活動佈景主題的 functions.php 文件中,或由另一個插件使用。

c2c_stealth_update_meta_key(過濾器)

「c2c_stealth_update_meta_key」過濾器允許您覆蓋插件用於存儲文章隱藏更新狀態的自定義字段鍵的名稱。這不是常見的需求。

參數:

$custom_field_key(字符串):插件要使用的自定義字段鍵。默認情況下,這是「_stealth-update」。

示例:

/**
* 定義 Stealth Update 要使用的自定義元鍵。
*
* @param string $custom_field_key 默認自定義元鍵名稱。
* @return string
*/
function override_stealth_update_key( $custom_field_key ) {
return '_my_custom_stealth-update';
}
add_filter( 'c2c_stealth_update_meta_key', 'override_stealth_update_key' );

c2c_stealth_update_default(過濾器)

「c2c_stealth_update_default」過濾器允許您覆蓋「隱藏更新?」複選框的默認狀態。

參數:

$state(布林值):複選框的默認狀態。默認情況下,為 false。
$post(WP_Post):當前創建/編輯的文章。

示例:

// 預設情況下勾選 Stealth Update 複選框。
add_filter( 'c2c_stealth_update_default', '__return_true' );

原文外掛簡介

This plugin allows you to choose to update a post without having WordPress automatically update the post’s post_modified timestamp.
WordPress maintains a post field called post_modified which tracks the date the post was last edited. This value is used by feeds to indicate the latest update to each post or to report the latest updated post. Plugins and themes may also reference the post modification date to call attention to posts that have been updated. However, if an update is such that you don’t want it to be recorded in the post_modified date field (perhaps due to the update being a small formatting/editing change or fixing a typo, or if you just want to keep quiet about an update), then this plugin is for you.
This plugin adds a “Stealth update?” checkbox to the “Publish” box of any post’s or page’s “Edit Post” admin page.
Note: The plugin records when a post is stealth updated, so subsequent edits of the post will have the “Stealth update?” checkbox checked by default.
Links: Plugin Homepage | Plugin Directory Page | Author Homepage
Filters
The plugin is further customizable via two filters. Typically, these customizations would be put into your active theme’s functions.php file, or used by another plugin.
c2c_stealth_update_meta_key (filter)
The ‘c2c_stealth_update_meta_key’ filter allows you to override the name of the custom field key used by the plugin to store a post’s stealth update 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-update’.

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

c2c_stealth_update_default (filter)
The ‘c2c_stealth_update_default’ filter allows you to override the default state of the ‘Stealth Update?’ 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 Update? checkbox checked by default.
add_filter( 'c2c_stealth_update_default', '__return_true' );

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Stealth Update」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.0 | 2.1 | 2.2 | 2.3 | 2.4 | 2.5 | 2.0.1 | 2.0.2 | 2.2.1 | 2.4.1 | 2.4.2 | 2.4.3 | trunk |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Mastodon