[WordPress] 外掛分享: External Linker

首頁外掛目錄 › External Linker
10+
安裝啟用
尚無評分
6066 天前
最後更新
問題解決
v0.2 上架:2009-07-26

內容簡介

你知道在 XHTML strict 中,target="_blank" 是無效的嗎?這個外掛使用了 Javascript hack 來解決這個問題。原始程式碼是從這個網頁中得到的:http://www.webmasterworld.com/forum21/11165.htm

對於文章/頁面,這個外掛會自動捕捉由 WP 編輯器插入的任何 target="_blank",然後修改它們以保持頁面符合 XHTML strict 規範。接著,每個頁面都會插入一些小型的 Javascript,以便在頁面通過驗證後重新插入 target="_blank",以恢復功能!

對於非文章/頁面的內容(例如模板/小工具),僅需給你的外向連結命名一個類別名稱 external,其餘的工作會自動完成,同時保持你的頁面符合 XHTML 規範。

待完成事項

我打算添加的未來功能:

將外掛整合到 WP 編輯頁面中,以便使用者無需手動編輯 HTML。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「External Linker」→ 直接安裝(推薦)

原文外掛簡介

You know how target="_blank" is invalid in XHTML strict? Well, this plugin uses a Javascript hack to get around this. The code was originally taken from this thread I came across: http://www.webmasterworld.com/forum21/11165.htm
For posts/pages, the plugin will automatically captures any target="_blank"‘s inserted by the WP editor and modifies them to keep the page XHTML Strict valid. Then some small Javascript is inserted into each page which re-inserts target="_blank" so that the functionality is restored after your page has been validated!
For non-post/page content (eg templates/widgets), simply give your outbound links a class name of external, and the rest will be done automatically while keeping your page XHTML valid.
To Do
Future things I plan to add:

Integration into WP edit page to allow use of plugin without manually editing HTML.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon