[WordPress] 外掛分享: Taxonomy Terms Counter

首頁外掛目錄 › Taxonomy Terms Counter
WordPress 外掛 Taxonomy Terms Counter 的封面圖片
全新外掛
安裝啟用
尚無評分
10 天前
最後更新
問題解決
WordPress 6.8+ PHP 7.4+ v2.0.0 上架:2026-02-21

內容簡介

總結:Taxonomy Terms Counter 外掛可將術語計數添加到 Gutenberg 編輯器側邊欄的分類面板中,使用者可在外掛設定頁啟用或禁用每個分類和文章類型的計數。

1. 使用 Taxonomy Terms Counter 外掛,能在 Gutenberg 編輯器側邊欄的分類面板中加入術語計數。
2. 如何啟用或禁用每個分類和文章類型的計數?- 可透過外掛設定頁進行調整。
3. 在哪裡可以找到完整的源代碼?- 可在 GitHub 頁面獲取:https://github.com/secretlab48/taxonomy-terms-counter
4. 這個外掛有哪些限制?
- 只支援 HIERARCHICAL 分類,不支援非 HIERARCHICAL 分類。
- 只適用於使用 Gutenberg 編輯器的管理文章螢幕。
- 不支援 Classic Editor。
- 若設定頁缺少現有的文章類型,可能 show_in_rest 設定為 false。
- 若文章類型缺少分類,可能 show_in_rest 設定為 false。
5. 提供了哪些 PHP Filters?
- ttcounter_term_count_taxonomies
- ttcounter_term_count_get_terms_args
- ttcounter_term_count_value
- ttcounter_term_counts_response
- ttcounter_sanitized_settings
6. 提供了哪些 PHP Actions?
- ttcounter_settings_updated
7. 提供了哪些 JS Filters?
- ttcounter.termCountTaxonomies
- ttcounter.termCountData
- ttcounter.restrictedPostTypes
- ttcounter.restrictedTaxonomies
- ttcounter.termCountLabel
8. 提供了哪些 JS Actions?
- ttcounter.sidebarUpdated

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Taxonomy Terms Counter」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Taxonomy Terms Counter adds term counts to taxonomy panels in the editor sidebar for both Gutenberg and Classic Editor.
You can enable or disable counts per taxonomy and post type from the plugin settings page.
Source Code
Full source code is available on GitHub:
https://github.com/secretlab48/taxonomy-terms-counter
Notes:
– The settings page lists taxonomies that are available in REST for the selected post type.
– The plugin works on admin post screens for both Gutenberg and Classic Editor.
– If an existing post type is missing on the settings page, it likely has show_in_rest set to false.
– If a taxonomy is missing for a post type, it likely has show_in_rest set to false.
Hooks
The plugin provides the following hooks for customization:
PHP Filters

ttcounter_term_count_taxonomies — Filter taxonomies list for term counts. Args: $taxonomies, $post_type, $request.
ttcounter_term_count_get_terms_args — Filter get_terms() args. Args: $args, $taxonomy, $post_type.
ttcounter_term_count_value — Filter count value per term. Args: $count, $term, $taxonomy, $post_type.
ttcounter_term_counts_response — Filter REST response. Args: $results, $post_type, $taxonomies.
ttcounter_sanitized_settings — Filter sanitized settings before save. Args: $sanitized_taxs, $request.
ttcounter_classic_hierarchical_label — Filter classic editor hierarchical label text. Args: $label, $term, $taxonomy, $post_type, $count.
ttcounter_classic_hierarchical_item_html — Filter classic editor hierarchical item HTML. Args: $item_output, $term, $taxonomy, $post_type, $count.
ttcounter_classic_flat_term_label — Filter classic editor flat term label key. Args: $label, $term, $taxonomy, $post_type, $count.

PHP Actions

ttcounter_settings_updated — Fires after settings are saved. Args: $sanitized_taxs, $request.

JS Filters

ttcounter.termCountTaxonomies — Filter taxonomy list before REST request. Args: taxonomies, postType.
ttcounter.termCountData — Filter REST response data before rendering. Args: data, postType.
ttcounter.restrictedPostTypes — Filter restricted post types list in settings. Args: restrictedPostTypes.
ttcounter.restrictedTaxonomies — Filter restricted taxonomies list in settings. Args: restrictedTaxonomies.
ttcounter.termCountLabel — Filter sidebar label text. Args: value, { name, count, label }.
window.TTCounterClassicFilterLabel — Filter classic editor flat checklist label text. Args: { taxonomy, name, count, label }.

JS Actions

ttcounter.sidebarUpdated — Fires after sidebar counts update. Args: termsByTax.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon