[WordPress] 外掛分享: Shortlinks By Path

首頁外掛目錄 › Shortlinks By Path
全新外掛
安裝啟用
尚無評分
5808 天前
最後更新
問題解決
WordPress 3+ v0.1 上架:2010-04-23

內容簡介

Shortlinks By Path 透過 WordPress 的 get_shortlink 過濾器來只回傳簡短連結的網址路徑,讓您能更輕鬆地取得不含網域名稱的相對路徑簡短連結。

預設情況下,當您在 WordPress 按下「取得簡短連結」時,它會回傳文章的完整網址路徑。然而啟用 Shortlinks By Path 後,WordPress 回傳的只有路徑,例如,預設情況下 WordPress 會回傳 http://blog.aizatto.com/?p=3565,啟用 Shortlinks By Path 後 WordPress 會回傳 /?p=3565。

它是如何運作的

Shortlinks By Path 透過 WordPress 的 get_shortlink 過濾器來只回傳簡短連結的網址路徑。

我為什麼建立它

我需要 WordPress 回傳文章的路徑,因為它能更輕鬆地遷移 WordPress 安裝到不同的網域,因為內部連結不會失效。例如,從開發內部網站遷移至正式網站。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1) 或搜尋安裝

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

原文外掛簡介

Shortlinks By Path hooks into the WordPress filter get_shortlink to only return the path for a shortlink. This makes it easier to retrieve the shortlink url with an absolute path minus the domain name.
By default WordPress returns the full path to your post when clicking “Get Shortlink”. Shortlinks By Path returns only the path. For example, by default WordPress would return http://blog.aizatto.com/?p=3565 , with Shortlinks By Path enabled WordPress returns /?p=3565 .
How It Works
Shortlinks By Path hooks into the WordPress filter get_shortlink to only return the path for a shortlink.
Why I Created It
I needed WordPress to return the path for a given post because it was easier to migrate WordPress installations across different domains, as there would be no broken internal links. For example, migrating from a development internal site, to a production live site.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon