[WordPress] 外掛分享: Change Last Modified Date

首頁外掛目錄 › Change Last Modified Date
3,000+
安裝啟用
★★★★
4.3/5 分(12 則評價)
190 天前
最後更新
0%
問題解決
WordPress 5.1+ PHP 5.6+ v1.4.8 上架:2017-07-28

內容簡介

使用這個外掛程式,您可以輕鬆更改或防止每個文章的「最後修改日期」更新。控制「最後修改日期」可以讓您方便地控制文章(或自訂文章型別)的「按最後修改日期排序」。

啟用此外掛程式後,將在側邊欄的「狀態與可見性」面板中啟用「最後修改日期」選項。您可以透過點擊日期鏈結並選擇文章的新日期,更改修改日期。也可以通過開啟「凍結修改日期」選項,禁用未來的最後修改日期更新。

自訂文章型別支援

為了更新「最後修改日期」,該外掛程式使用「rest_pre_insert_{$post_type}」鉤子,該鉤子在「init」執行之前執行,而其他自訂文章型別通常是在此註冊的。這是該外掛程式不知道任何 WordPress 核心以外的其他額外文章類型的原因。如果要支援其他文章類型,您可以在 wp-config.php 中添加以下格式的常數:

define( 'CLM_DATE_POST_TYPES', ['post-type-slug-1', 'post-type-slug-2'] );

自訂文章型別還需要聲明「自訂欄位」支援。

支援

如需支援或代碼貢獻,請參閱 Github 存儲庫。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.4.8) 或搜尋安裝

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

原文外掛簡介

Using this plugin you can easily change or prevent updating the last modified date for each post. Controlling the last modified date can come in handy when you would like to control “order by last modified” for posts (or custom post type).
When this plugin is active it will enable Last modified date options in Status & Visibility panel in sidebar. Changing the modified date can be done by clicking the date link and selecting a new date for the post. It’s also possible to disable future updates of the last modified date by setting the “Freeze modified date” option to on.
Custom post types support
To update the last modified date, plugin is using “rest_pre_insert_{$post_type}” hook which is executed before “init” where other custom post types are usually registered. This is the reason why plugin is not aware of any additional post types other than those registered by WordPress core. To support additional post types you can add constant in following format to wp-config.php:
define( 'CLM_DATE_POST_TYPES', ['post-type-slug-1', 'post-type-slug-2'] );

Custom post types are also required to have “custom-fields” support declared.
Support
For support or code contributions please refer to Github repo.

文章
Filter
Apply Filters
Mastodon