[WordPress] 外掛分享: Limit taxonomy term count

WordPress 外掛 Limit taxonomy term count 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Limit taxonomy term count」是 2018-10-22 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2018-10-23,距離現在已有 2385 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.7 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

dahousecatz |

外掛標籤

taxonomy | taxonomy-term |

內容簡介

WordPress 預設不允許您限制聯結到文章的分類法(term)數量。
啟用此外掛程式,將可在初始化呼叫 register_taxonomy() 時使用「限制」屬性。
如果限制設為1,則只能添加一個分類法至文章。如果限制大於1,就可以添加該數量的分類法至文章。如果未設置限制屬性,或設為 -1,此外掛程式將不會產生影響。

以下為示範程式碼,展示如何使用限制屬性:

register_taxonomy('artists', 'art_work', [
'label' => 'Artists',
'show_ui' => true,
'limit' => 1,
]);

此範例展示如何使用名為「artists」自訂分類法,並使用的文章類型為「art_work」。

以下是另一個範例,這次是編輯先前註冊的分類法「post_tag」:

// 首先載入分類法
$taxonomy = get_taxonomy('post_tag');

// 現在將其編輯為每篇文章只能添加2個標籤
$taxonomy->limit = 2;

// 最後,使用我們更新過的設定 (請注意在進行註冊之前將物件轉換為矩陣)
register_taxonomy('post_tag', 'post', (array)$taxonomy);

原文外掛簡介

By default WordPress does not allow you to limit how many taxonomy terms can be attached to a post.
Enabling this plugin allows the use of the “limit” attribute when initially calling register_taxonomy().
If the limit is set to 1 then only one term can be added to the post. If the limit is greater than one then that many
terms may be added to the post. If the limit is attribute is not set, or it’s set to -1 this plugin has no effect.
Example code showing the use of the limit attribute:
register_taxonomy('artists', 'art_work', [
'label' => 'Artists',
'show_ui' => true,
'limit' => 1,
]);

This example shows the use of a custom taxonomy called “artists” and the post type is “art_work”.
Here is another example but this time it’s editing the previously registered taxonomy “post_tag”:
// First load the taxonomy
$taxonomy = get_taxonomy('post_tag');

// Edit it to only allow 2 tags to be added per post
$taxonomy->limit = 2;

// Re-save it with our updated settings (note casting the object to an array before saving)
register_taxonomy('post_tag', 'post', (array)$taxonomy);

各版本下載點

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

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


1.0 | 1.1 | trunk |

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

  • Custom Post Type UI 》Custom Post Type UI 提供了易於使用的界面,以便為您的網站註冊和管理自定義文章類型和分類法。, Custom Post Type UI Extended, CPTUI 協助建立自定義內容...。
  • 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 搜尋框的進階版。, 您可以透過類別、標籤、自訂分類、文章類型、發佈日期或...。
  • Related Posts by Taxonomy 》此外掛可以讓你快速增加讀者的參與度,透過小工具或簡碼在側邊欄或文章內容後加入相關文章。有相同詞彙數量的文章會顯示在最前面!此外掛可以在多個種類和文...。
  • Radio Buttons for Taxonomies 》此外掛可將預設的分類方塊替換為使用單選按鈕的自訂 metabox…從而限制每篇文章在該分類中只能選擇一個術語。, 插件選項頁面允許使用者選擇要切換為使用...。
  • Custom Post Type Widgets 》此 WordPress 外掛可以添加預設的自訂文章類型小工具。, 您可以在小工具上篩選已註冊的自訂文章類型或分類法。, , 小工具描述, , 最新文章 (自訂文章類型), ...。
  • Term Management Tools 》請注意,此外掛需要至少 PHP 7.1。, 如果您需要重新組織標籤和分類,此外掛可以讓您更輕鬆地進行操作。它在條目管理頁面的“批次操作”下拉菜單中添加了三個新...。
  • Taxonomy Images 》在你的主題中顯示圖像, 有一些過濾器可以在你的主題中使用,來顯示此外掛創建的圖像關聯。請閱讀以下詳細信息。, 顯示代表術語檔案庫的單個圖像, 以下過濾器...。
  • PS Taxonomy Expander 》PS Taxonomy Expander 可以讓您更輕鬆地在編輯文章時使用類別、標籤和自訂分類法。, 功能, , 啟用將分類法核取方塊變成有階層的單選按鈕功能。, 讓您在 WordP...。
  • Posts in Page 》使用簡單的簡碼 (shortcodes),輕鬆地將一個或多個文章添加到任何頁面。, 支援類別 (categories)、標籤 (tags)、自訂文章類型 (custom post types)、自訂稅項...。
  • WP Term Order 》按照您的方式對分類法詞進行排序。, WP Term Order 允許使用者以數字方式對任何可見的類別、標籤或分類法詞進行排序,為其分類法提供定制排序。, 同時也請查...。
  • Taxonomy Metadata 》此外掛實現了分類術語的元數據基礎設施,因此您可以向標籤、類別和其他分類術語中添加自定義元數據(按鍵)。大部分代碼來自於sirzooro提交到 WordPress Core...。
  • Remove Taxonomy Base Slug 》如果您想要對您的自訂文章類型文章使用更好的固定連結,並使用自訂的固定連結,這個外掛程序可以協助您。, 如果該術語的slug和文章類型相同,那麼該分類的優...。
  • HTML Import 2 》此外掛可匯入格式完整的靜態 HTML 檔案到 WordPress。需要 PHP 5 及以上版本。, 此插件可將一個目錄的檔案匯入為頁面或文章。您可以指定包含您想匯入內容的 H...。
  • JC Submenu 》JC子選單外掛允許你自動填入自定義的文章類型、分類或子頁面到導覽選單中。此外掛容易使用,並被設計成為一個輕量化的選單擴充套件。, 透過我們的進階子選單...。

文章
Filter
Apply Filters
Mastodon