[WordPress] 外掛分享: Custom Post Type Permalinks

WordPress 外掛 Custom Post Type Permalinks 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Custom Post Type Permalinks」是 2011-12-02 上架。
  • 目前有 200000 個安裝啟用數。
  • 上一次更新是 2024-10-10,距離現在已有 206 天。
  • 外掛最低要求 WordPress 6.1 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 71 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

inc2734 | ixkaito | strategio | toro_unit | keita_kobayashi |

外掛標籤

url | link | address | permalink | custom post type |

內容簡介

自訂文章類型永久連結允許您編輯自訂文章類型的永久連結結構。

更改自訂分類目錄的永久鏈接,以“example.org/post_type/taxonomy_name/term_slug”的形式。可禁用此修復。

支援wp_get_archives( 'post_type=foo' )和文章類型日期檔案存檔(例如example.com/post_type_slug/date/2010/01/01)。

這款外掛已發佈在 GitHub 上。

捐款:請發送我的願望清單或Paypal

翻譯人員

日語(ja) – Toro_Unit
法語(fr_FR) – Geoffrey Crofte
俄語(ru_RU) – Olart、Natali_Z

請參閱

簡單文章類型永久連結

代碼設置

示例:

register_post_type( 'foo',
array(
'public' => true,
'has_archive' => true,
'rewrite' => array(
"with_front" => true
),
'cptp_permalink_structure' => '%post_id%'
)
);
排除特定的文章類型
add_filter( 'cptp_is_rewrite_supported_by_foo', '__return_false' );

// 或者

add_filter( 'cptp_is_rewrite_supported', function ( $support , $post_type ) {
if ( 'foo' === $post_type ) {
return false;
}
return $support;
}, 10, 2);

原文外掛簡介

Custom Post Type Permalinks allow you edit the permalink structure of custom post type.
Change custom taxonomy archive’s permalink to “example.org/post_type/taxonomy_name/term_slug”. Can disable this fix.
And support wp_get_archives( 'post_type=foo' ) and post type date archive (ex. example.com/post_type_slug/date/2010/01/01 ).
This Plugin published on GitHub.
Donation: Please send My Wishlist or Paypal
Translators

Japanese(ja) – Toro_Unit
French(fr_FR) – Geoffrey Crofte
Russian(ru_RU) – Olart, Natali_Z

Also checkout

Simple Post Type Permalinks

Setting on Code
Example:
register_post_type( 'foo',
array(
'public' => true,
'has_archive' => true,
'rewrite' => array(
"with_front" => true
),
'cptp_permalink_structure' => '%post_id%'
)
);
Exclude specific post type
add_filter( 'cptp_is_rewrite_supported_by_foo', '__return_false' );

// or

add_filter( 'cptp_is_rewrite_supported', function ( $support , $post_type ) {
if ( 'foo' === $post_type ) {
return false;
}
return $support;
}, 10, 2);

各版本下載點

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

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


0.6 | 0.7 | 0.8 | 0.9 | 0.6.1 | 0.6.2 | 0.7.1 | 0.7.2 | 0.7.3 | 0.7.4 | 0.7.5 | 0.7.6 | 0.7.8 | 0.7.9 | 0.8.1 | 0.8.6 | 0.8.7 | 0.9.1 | 0.9.5 | 0.9.6 | 1.0.0 | 1.0.1 | 1.0.2 | 1.0.3 | 1.0.4 | 1.0.5 | 1.1.0 | 1.2.0 | 1.3.0 | 1.3.1 | 1.4.0 | 1.5.1 | 1.5.2 | 1.5.4 | 2.0.0 | 2.0.1 | 2.0.2 | 2.1.1 | 2.1.2 | 2.1.3 | 2.2.0 | 3.0.0 | 3.0.1 | 3.1.0 | 3.1.1 | 3.1.3 | 3.1.4 | 3.1.5 | 3.2.0 | 3.2.1 | 3.2.2 | 3.3.0 | 3.3.1 | 3.3.4 | 3.3.5 | 3.4.0 | 3.4.1 | 3.4.2 | 3.4.3 | 3.4.4 | 3.4.5 | 3.5.2 | 3.5.3 | trunk | 0.7.10 | 0.7.2.1 | 0.7.3.1 | 0.7.4.1 | 0.7.5.1 | 0.7.5.2 | 0.7.5.6 | 0.7.9.1 | 0.7.9.2 | 0.8.7.1 | 0.8.7.5 | 0.8.7.6 | 0.9.2.1 | 0.9.3.1 | 0.9.3.2 | 0.9.3.3 | 0.9.5.1 | 0.9.5.2 | 0.9.5.3 | 0.9.5.4 | 0.9.5.6 | 3.4.0-rc.1 |

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

  • Custom Permalinks 》name or slug), add the filter that looks like this:, function yasglobal_exclude_posts( $post ) {, // Replace '2' with ID of the post you want to ...。
  • Simple Map 》使用gmaps.js輕鬆嵌入 Google 地圖的外掛程式。, 這個外掛程式允許您將地址轉換成類似下面的 Google 地圖:, [map]加州舊金山[/map], , 另一種方法是只用 URL...。
  • Five Star Business Profile and Schema 》此外掛可以在網站的任何頁面或文章類型上加入 schema 結構化資料,也輕易地創建一張聯絡卡片,並加上正確的結構化資料。讓你的網站增加 SEO 友好的 Schema.or...。
  • Speed Contact Bar 》讓您的網站訪客輕鬆聯繫您,提供永久可見的聯繫方式。, 外掛有英文、西班牙文 (Español)、俄語 (ру́сский)、德文 (Deutsch)、波蘭文 (Polski)等多種語言版本...。
  • Portugal States (Distritos) for WooCommerce 》這個外掛可為 WooCommerce 新增 18 個葡萄牙「州」(被稱為「Distritos」),以及兩個自治區(被稱為「Regiões Autónomas」,分別是馬德拉和亞速爾群島)。, ...。
  • WooCommerce Address Book 》本外掛給予您的顧客存儲多個帳單和送貨地址的選項,並在結帳時檢索它們。地址可以在/my-account/中快速方便地更新和修改,或者在結帳過程中保存。, 如果您想...。
  • WooCommerce Email Validation 》「WooCommerce Email Validation」是一個針對 WooCommerce 的外掛程式,可以在結帳頁面加入「確認電子郵件地址」欄位,並將其設為必填欄位。這可以確保您的顧...。
  • Address Autocomplete via Google for Gravity Forms 》這是一個簡單且好用的外掛程式,可以在 Gravity Form 地址欄位中使用 Google 地址自動建議 API 。如果安裝完成後,請進入 Gravity Form 的選單 ‘Autoco...。
  • Woocommerce autocomplete checkout address 》這個外掛程式是為了 WooCommerce 結帳時的地址欄位而設計的,它可以幫助您在 Google 上找到地址。, 功能:, 地址建議相關於選定的國家。, 與 WooCommerce 所...。
  • More Widgets 》WordPress的More Widgets外掛程式為你的WordPress站台的小工具範圍提供額外的小工具。使用此外掛程式來替代內建主題的小工具,這樣當你切換主題時,你的小工...。
  • Enhanced Custom Permalinks 》這個外掛程式是 Custom-Permalinks 外掛程式的分支,除了修正一些擴充的錯誤之外,還可以與 WP-no-category-base 外掛程式互相操作。, 這個外掛程式讓你更精...。
  • Embed Google Map 》Embed Google Map 是一款在 WordPress 文章、頁面、文字小工具以及模板中嵌入一個或多個 Google 地圖的外掛。添加地圖非常簡單,只需將您想在地圖上顯示的位...。
  • BP xProfile Location 》此外掛可與「BuddyPress」和「BuddyBoss 平台」搭配使用。它會建立「xProfile 位置」欄位類型,使用 Google Places API 來填寫和驗證會員檔案上的地址欄位。,...。
  • Address correction autocomplete for Woo 》這個針對 WooCommerce 的外掛程式使用 Google API 實現自動地址校正,並且應用在結帳流程中。, 功能特色, , 地址建議會根據所選擇的國家提供。, 與 WooCommer...。
  • Pixeline's Email Protector 》此外掛提供了一種非侵入式但高效的方式來保護郵件地址免受郵件收割機 / 垃圾郵件機器人的攻擊。這裡提供了一個示範。, 文章 / 頁面作者可以按照通常的格式(&...。

文章
Filter
Apply Filters
Mastodon