內容簡介
Strict Permalinks 給予您兩個功能:
限制永久網址 (permalink) 中 post_name 的部分只能使用英數字母和連字號
當發佈文章後,停用永久網址的編輯功能
和我一樣的人,可能會誤以為發佈文章時的網址只能使用英數字母和連字號。其實在現行的 WordPress 2.8.5 中,如果標題帶有某些類型的標點符號 (例如「智慧引號」),這些符號在 post_name 欄位中會轉為 URL 編碼的字元。許多瀏覽器可以無縫地處理這個怪異現象,然而這可能會在與仰賴更為有限的 URL 句法的系統整合時造成困難。
升級
使用 WordPress 內的外掛更新程式更新,或者…
從 /wp-content/plugins/ 目錄刪除先前的 strict-permalinks 資料夾
上傳新的 strict-permalinks 資料夾到 /wp-content/plugins/ 目錄
用法
對於所有情況,從 post_title 到 post_name 的轉換 (也就是 sanitize_title 過濾器) 只會使用 a-z、0-9 和連字號 (-)。
如果一個文章還未發佈,永久網址可以像往常一樣編輯。
一旦一個文章被發佈,永久網址的編輯介面就停用了。
外掛標籤
開發者團隊
原文外掛簡介
Strict Permalinks does two things:
Restricts the post_name portion of the permalink to alphanumerics and hyphens
Disables permalink editing once a post is published
Like me, you may have been under the impression that post slugs are already restricted to alphanumerics and hyphens. In the current WordPress 2.8.5, a title that includes certain kinds of punctuation (e.g., “smartquotes”) will result in URL-encoded characters in the post_name field. Many browsers handle this oddity seamlessly, however this may cause difficulties when integrating with systems expecting a more limited URL syntax.
Upgrade
Use the plugin updater in WordPress or…
Delete the previous strict-permalinks folder from the /wp-content/plugins/ directory
Upload the new strict-permalinks folder to the /wp-content/plugins/ directory
Usage
In all cases the post_title to post_name conversion (i.e., the sanitize_title filter) will be limited to a-z, 0-9 and hyphens (-).
If a post is not yet published, the permalink can be edited as usual.
Once a post is published, the permalink editing interface is disabled.
