[WordPress] 外掛分享: Shortlinks

前言介紹

  • 這款 WordPress 外掛「Shortlinks」是 2010-04-14 上架。
  • 目前有 30 個安裝啟用數。
  • 上一次更新是 2010-04-15,距離現在已有 5498 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3 以上版本才可以安裝。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

aizatto |

外掛標籤

page | post | pages | posts | category |

內容簡介

Shortlinks 可以讓您輕鬆擷取 WordPress 貼文(post)、頁面(page)、分類(category)、文章標籤(post_tags)、附件(attachments)、自訂貼文類型(custom post types)以及自訂分類(custom taxonomies)的短網址(shortlink)。

預設情況下,WordPress 使用查詢字串來載入貼文、頁面、分類等等(例如:http://blog.aizatto.com/?page_id=3565),但當您啟用固定連結時,查詢字串會被 WordPress 重導規則隱藏。好看的 URL 很棒,但也使網站較不靈活。例如,變更文章的發布日期會變更其 URL。

即便我們無法控制其他人如何連結至我們的網站,但我們可以控制自己連結至我們內部網站的方式。

啟用固定連結時,預設情況下,當訪問 WordPress 的短網址時,WordPress 會將您重新導向至固定連結 URL。

如何運作

Shortlinks 連結至 WordPress Filter get_shortlink,以啟用所有 WordPress 類型的短網址。

您可以將 Shortlinks 移植至自己的佈景主題或外掛程式。

若要為貼文、頁面或自訂貼文類型返回短網址,其中 $id 代表 ID:

若要為分類返回短網址,其中 $id 代表分類 ID:

若要為自訂分類返回短網址,其中 $id 代表術語 ID,而 $taxonomy 代表自訂分類:

我為什麼要創建它

WordPress 預設支援短網址,但只允許使用者取得貼文的短網址。我認為這不足以滿足需求,因此我創建了此外掛程式以取得所有內容類型的短網址。

原文外掛簡介

Shortlinks allows you to easily retrieve the shortlink for your WordPress posts, pages, categories, post_tags, attachments, custom post types, and custom taxonmies.
By default, WordPress uses links a query string ( ie: http://blog.aizatto.com/?page_id=3565 ) to load up your posts, pages, categories, etc. But when you enable permalinks, the query string is hidden by the WordPress rewrite rules. Having pretty urls is great, but also makes the website less flexible. For example, changing a posts published date will change the URL.
While we can’t control how other people will link to our site, we can control how we link to our internal sites.
By default, with permalinks enabled, when visiting WordPress with a shortlink, WordPress will redirect you to the permalink URL.
How It Works
Shortlinks hooks into the WordPress filter get_shortlink to enable shortlinks for all WordPress types.
You can use Shortlinks in your own theme or plugin.
To return the shortlink for a post, page, or custom post type, where $id represents the ID:

To return the shortlink for a category, where $id represents the category id:

To return the shortlinks for custom taxonomy, where $id represents the term id, and $taxonomy represents the custom taxonomy:

Why I Created It
WordPress supports shortlinks by default, but only allows the user to get the shortlink for a post. Finding it unacceptable, I created a plugin to get shortlinks for all content types.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Shortlinks」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | trunk |

延伸相關外掛(你可能也想知道)

  • FileBird – WordPress Media Library Folders & File Manager 》Media Folder 是史上最佳的 WordPress 外掛,可讓您使用資料夾對媒體庫進行分類。, 我們可以使用拖放式組織方式整理 WordPress 媒體庫資料夾。, 試用 | 升級...。
  • Pages with category and tag 》在頁面中新增分類和標籤。。
  • WordPress Tag, Category, and Taxonomy Manager – AI Autotagger 》axoPress allows you to show a customizable display of the terms assigned to the current post. You can choose which taxonomy and which format to dis...。
  • Search & Filter 》Search & Filter 是一款簡單的 WordPress 搜尋和篩選外掛程式,是 WordPress 搜尋框的進階版。, 您可以透過類別、標籤、自訂分類、文章類型、發佈日期或...。
  • Remove Category URL 》這個外掛可以徹底將 WordPress 網站的連結結構中的「/category/」去除(例如:從 mydomain.com/category/my-category/ 變成 mydomain.com/my-category/ )。,...。
  • Category Posts Widget 》Category Posts Widget是一個輕巧的小工具,設計用於一件事並且做得很好:顯示特定類別中最新的文章。, 基於詞語和類別的文章小工具, 這個免費小工具的高級版...。
  • Media Library Categories 》此外掛可允許在 WordPress 媒體庫中使用分類。啟用後,媒體庫中會顯示下拉式的分類清單。, 您可以使用大量動作進行多項目的分類更改、新增或移除分類。, 在使...。
  • Add Category to Pages 》「Add Category to Pages」外掛讓你能夠快速新增 WordPress 頁面的分類和標籤。, 這個外掛能夠為 WordPress 頁面加上 WordPress 分類的功能。, 啟用外掛後,...。
  • WP No Base Permalink 》該外掛能夠將分類基礎從您的分類永久連結中移除 (可選)。默認情況下啟用。, 該外掛能夠從您的分類永久連結中移除父級分類 (可選)。, 該外掛能夠將標籤基礎從...。
  • Advance WordPress Search Plugin 》WooCommerce Advance Product Search是WooCommerce最快的搜尋外掛程式,支援AJAX搜尋和搜尋結果頁面顯示。, TH Advance Product Search是一個強大的基於AJAX...。
  • Term Management Tools 》請注意,此外掛需要至少 PHP 7.1。, 如果您需要重新組織標籤和分類,此外掛可以讓您更輕鬆地進行操作。它在條目管理頁面的“批次操作”下拉菜單中添加了三個新...。
  • Taxonomy Images 》在你的主題中顯示圖像, 有一些過濾器可以在你的主題中使用,來顯示此外掛創建的圖像關聯。請閱讀以下詳細信息。, 顯示代表術語檔案庫的單個圖像, 以下過濾器...。
  • PS Taxonomy Expander 》PS Taxonomy Expander 可以讓您更輕鬆地在編輯文章時使用類別、標籤和自訂分類法。, 功能, , 啟用將分類法核取方塊變成有階層的單選按鈕功能。, 讓您在 WordP...。
  • Parent Category Toggler 》當選擇子目錄時,自動切換到父目錄。, 1.3.4, , 相容更新 WordPress 4.8。, , 1.3.3, , 測試過 WP 4.4。, , 1.3.2, , 只在 wp-admin 的文章 (也包括自訂文章...。
  • List Custom Taxonomy Widget 》清單自訂分類小工具是一種快速且簡單的方式,可以顯示自訂分類。只需從自動填充的清單中選擇要顯示的分類名稱即可。您還可以設置小工具要顯示的標題。可以將...。

文章
Filter
Mastodon