[WordPress] 外掛分享: Dynamic Links

首頁外掛目錄 › Dynamic Links
20+
安裝啟用
★★★★★
5/5 分(2 則評價)
4425 天前
最後更新
問題解決
WordPress 3.2+ v0.2 上架:2011-12-15

內容簡介

在文章中插入圖片時,WordPress 會在圖片的 src 和 href 屬性上使用絕對 URL(即包括網域名稱),並且會在相關聯的連結上使用相同的方式。但如果您更改了網域名稱(例如從測試環境變成正式環境)或上傳目錄的基本路徑,這樣做將會帶來問題。此外,使用相對 URL(即不包括網域部分的絕對文件路徑)可以減少文件大小,但在饋送中可能無法使用。

動態連結將上傳目錄中所有文件的連結替換為占位符,當檢視內容時,占位符將再次被替換為上傳目錄的基本路徑,因此圖像連結會根據網域名稱或上傳基本路徑的變化進行動態調整。

作為額外選項,當在您的網站上顯示內容時,可以使用相對連結以減少頁面大小(儘管有更好的選項可供選擇,而它只是因為可行而被包含)。饋送中的圖像和連結始終會得到完整的路徑。

許可證

本程式是自由軟體,您可以在自由軟體基金會發布的 GNU 通用公共授權條款第 2 版或任何之後版本下再分發或修改它。
本程式是基於 "現狀" 提供,沒有任何明示或暗示的擔保或條件保證,開發者也不對程式的特定目的進行擔保。詳情請參閱 GNU 通用公共授權條款。

外掛標籤

開發者團隊

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

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

原文外掛簡介

When inserting an image into a posts WordPress uses absolute urls (i.e. including domain name) for the src and href attributes of the image and associated link. This leads to problems if you change your domain (e.g. when moving from test to production environment) or if you change the base path of your upload directory. Also usage of relative URLs (i.e. absolute path to file without domain part) can reduce file size, but may not be used in feeds.
Dynamic Links replaces all links to files in the upload directory with a placeholder which is replaced again with the base path to the upload dir when the content is viewed. This way image links are dynamically adapted to changes in domain name or upload base path.
As additional option relative links can be used when content is display on your site to reduce page size (Though there are better options to do this. It’s just included because it’s possible). Images and links in feeds will always get the full path.
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon