[WordPress] 外掛分享: Cache Time

首頁外掛目錄 › Cache Time
全新外掛
安裝啟用
尚無評分
6440 天前
最後更新
問題解決
WordPress 2.0+ v1.02 上架:2008-05-15

內容簡介

Cache Time 可以顯示當前頁面的緩存時間,並通過 cache_time(); 函數進行打印。它考慮了 WordPress 博客的不同時區,以及 WP-Cache 是否阻止緩存當前 URL。

它已經在 WP 2.6 和 WP-Cache 上進行了測試,所以如果使用其他系統有任何問題或疑問,請與我聯繫。WP-Super-Cache 應該可以正常工作,但沒有官方測試。

請務必查看我的 WordPress 資料檔 中的其他插件。

使用方法

在 WordPress 模板頁面中的任何位置,複製<?php cache_time(); ?> 以打印插件的輸出。

自定義

Cache Time 可以自定義 3 個元素:

頁面緩存時顯示的文字 - 在 Cache-time 文件夾中用您喜歡的文本編輯器打開 cache-time.php,找到第 27 行 $cached = 'Page cached on: ';。更改引號中的文本為您自己的信息。
如果沒有緩存,顯示的文字 - 與上面類似,在第 29 行找到 $not_cached = 'Time is now: ';,並更改引號中的文本。
日期格式 - 再次在 cache-time.php 文件中,第 36 行可以更改以顯示您選擇的信息。有關自定義日期的更多詳細信息,請查看w3schools。

限制

目前 Cache Time 僅適用於 WP-Cache,但在理論上,它也應該適用於 WP-Super-Cache。

外掛標籤

開發者團隊

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

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

原文外掛簡介

Cache Time displays the time that the current page was cached, and prints it via the cache_time(); function. It takes into account the different time zones of the WordPress blog, and whether or not WP-Cache has blocked the current URL for caching.
It has been tested with WP 2.6 and WP-Cache only, so please contact me with any questions or concerns with other systems. WP-Super-Cache should work, but it is not officially tested.
Be sure to check out my other plugins at my WordPress profile.
USAGE

Anywhere inside the WordPress template pages, copy to print the plugin’s output.

CUSTOMIZATION
There are 3 elements that can be customized with Cache Time:

Text displayed when page is cached — Open cache-time.php inside the Cache-time folder with your favorite text editor and find line 27 that says $cached = 'Page cached on: ';. Change the text between the quotes for your own message.
Text displayed if no cache is present — Similar to above, find line 29 that says $not_cached = 'Time is now: '; and change the text between the quotes.
Date Format — Again inside the cache-time.php file, line 36 can be changed to display your choice of information. More details about customizing the date can be found at w3schools.

LIMITATIONS

Currently Cache Time only works with WP-Cache, though theoretically it should work with WP-Super-Cache as well.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon