Public Post Preview

外掛說明

這個外掛能讓作者在發佈內容前,提供特殊連結給需要的人,知道該連結的人便能預覽該項尚未發佈的文章或其他內容類型的內容。

你是否曾經在內容尚未發佈前,想辦法讓沒有網站權限的使用者先行預覽內容,然後在他的協助下才能完成內容撰寫?這個外掛能產生一個具有時限性、能夠預覽內容的網址。

之前這個外掛由 Jonathan Dingman 發想,並由 Matt Martz 開發維護,同時也感謝 Hans Dinkelberg 所提供的照片

使用方式

  • 在內容編輯頁的 [發佈] 功能區中,核取 [啟用公開預覽] 便能啟用這項功能。
  • 功能啟用後,內容預覽網址便會出現於設定下方,複製這個網址並分享給有需要的人。
  • 取消核取 [啟用公開預覽] 便能在該篇內容中停用這項功能。

螢幕擷圖

  • 內容編輯頁面

安裝方式

請注意,這個外掛沒有設定頁面。

透過 WordPress 自動安裝:

  1. 前往 WordPress 管理後台的 [安裝外掛] 頁面。
  2. 搜尋「Public Post Preview」。
  3. 點擊 [立即安裝] 並啟用這個外掛。

透過 FTP 手動安裝:

  1. 上傳解壓縮後的 public-post-preview 目錄及目錄中的檔案至網站主機的 /wp-content/plugins/ 目錄中。
  2. 在 WordPress 管理後台的 [外掛] 頁面中啟用這個外掛。

透過 WordPress 上傳外掛,而不是透過 FTP 上傳:

  1. 在本頁右上方點擊 [下載],然後在 WordPress 管理後台的 [安裝外掛] 頁面中上傳已下載至本機的 ZIP 檔案並完成啟用。

常見問題集

找不到預覽連結的設定,這項設定位於何處?

這項設定僅出現於尚未發佈的內容,以及將 [狀態] 變更為 [草稿] 的內容。

為什麼在過了一段時間後,透過預覽連結檢視內容會顯示 [這條連結已到期失效!]?

這個外掛所產生的內容預覽網址有其時限,網址使用時限預設為 48 小時。48 小時過後,預覽連結便會到期,內容作者必須在內容編輯頁面中複製外掛所產生的新網址,並分享給有這項需要的使用者。

預覽連結預設 48 小時的使用期限對某些人來說不太夠,是否有辦法變更這項預設設定?

當然可以,使用 ppp_nonce_life 篩選器便可設定連結有效期限。以下範例程式碼能將預覽期限延長至 5 天:

add_filter( 'ppp_nonce_life', 'my_nonce_life' );
function my_nonce_life() {
    return 5 * DAY_IN_SECONDS;
}

或是安裝並啟用 Public Post Preview Configurator 外掛,也能變更這項設定。

使用者評論

2024 年 2 月 7 日
Just used for a nice way for a client to approve new WooCommerce products. Easy-peasy.
2023 年 3 月 29 日
I have been using this plugin for a very long time and like it. but I just don't understand why there is no setting where I can specify the validity period of the link. That would be so easy. Instead, I have to either manually mess around in the code or install a SEPARATE PLUGIN that does this really very simple job. The plugin is really great, but apparently they just stopped at the crucial point. Really a great pity.
2022 年 11 月 20 日
This is a great plugin that should be officially incorporated into WordPress.
2022 年 8 月 12 日
I like the plugin, a lot. But it could be SO MUCH better if you could just extend the 48 hours to let's say, a week or even two. Because let's face it, most of us use this tool for clients so that they can see the work, before approving it. The thing is that they receive the preview mail and aren't able to check the preview in such a short time period. Add weekend and different time zones to that, and it makes this plugin pretty much useless because you keep sending preview links back and forth over and over again. The short timeframe makes the plugin so much worse than it could be. I really don't understand this choice. Yes, there is code that you can manually add. But the whole point of a plugin is to stay away from manual coding. And yes, there is also another plugin that lets you extend the preview time. But that means another plugin to keep up-to-date, more drag on the server and increasing security risks. So please. You can make this plugin 90% better just by increasing the timeframe, or letting the user decide the timeframe.
閱讀全部 72 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Public Post Preview〉的開發相關工作。

參與者

〈Public Post Preview〉外掛目前已有 24 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Public Post Preview〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

2.10.0 (2022-11-19):

  • Compatibility with WordPress 6.1.
  • Integrate with User Switching: Direct the user to the public preview of a post when they switch off from the post editing screen. Props @johnbillion.

2.9.3 (2021-03-12):

  • Compatibility with WordPress 5.7.
  • Create a fresh preview URL when enabling public preview.
  • Add check for possibly undefined PHP “superglobals”. Props @waviaei.

For more see CHANGELOG.md.