[WordPress] 外掛分享: Page Siblings

首頁外掛目錄 › Page Siblings
WordPress 外掛 Page Siblings 的封面圖片
20+
安裝啟用
★★★★★
5/5 分(1 則評價)
370 天前
最後更新
問題解決
WordPress 3.0+ v1.0.8 上架:2012-11-01

內容簡介

您曾經遇到必須管理許多網頁和子頁面的 WP 安裝嗎?此外掛的功能就是為每個具有階層結構的文章類型(例如頁面和任何其他自訂文章類型!)添加一個元框,其中包含所有頁面同層級的列表,從父級開始,所以您可以擁有以下列表:

新聞
|— 歷史
|— 我們的員工
|—— 職位空缺
|— 我們的公司

額外的好處是:當您在管理頁面列出文章時,您還可以選擇只顯示父級文章。

API

您可以通過使用篩選器來選擇禁用某些(或所有!)功能。這些篩選器如下:

完全禁用頁面同層級元框:

add_filter('iamntz/page-siblings/add-page-metabox', '__return_false')

對於 my-custom-post-type

add_filter("iamntz/page-siblings/add-page-metabox/post-type=my-custom-post-type", '__return_false')

禁用下拉式選單,以便您過濾出父級文章或父級文章和子文章

add_filter('iamntz/page-siblings/add-hierarchy-column-filter', '__return_false')

對於 my-custom-post-type:

add_filter('iamntz/page-siblings/add-hierarchy-column-filter/post-type=my-custom-post-type', '__return_false')

設定下拉式選單的預設值:

add_filter('iamntz/page-siblings/add-hierarchy-column-filter', function() { return 'parents_only'; })

對於 my-custom-post-type:

// 允許的值為 `all` 和 `parents_only`。
add_filter('iamntz/page-siblings/hierarchy-column-filter-default/post-type=my-custom-post-type', function() { return 'parents_only'; })

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.8) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Page Siblings」→ 直接安裝(推薦)

原文外掛簡介

Ever had to manage a WP install with many pages and subpages? This plugin does nothing more than adding a metabox to every post type that is hierarchical (that is pages and any other custom post type!) with a list of all page siblings, starting with the parent, so you can have:
News
|— History
|— Our Staff
|—— Employment Opportunities
|— Our Company

Bonus: when you’re listing posts on admin pages, you can also choose to display only parents.
API
You can choose to disable some (or all!) functionality by using filters. These filters are as following:
Disable page siblings metabox completely:
add_filter('iamntz/page-siblings/add-page-metabox', '__return_false')

For my-custom-post-type
add_filter("iamntz/page-siblings/add-page-metabox/post-type=my-custom-post-type", '__return_false')

Disable the dropdown that will allow you to filter page parents or page parents & children
add_filter('iamntz/page-siblings/add-hierarchy-column-filter', '__return_false')

For my-custom-post-type:
add_filter('iamntz/page-siblings/add-hierarchy-column-filter/post-type=my-custom-post-type', '__return_false')

Set the default value for the dropdown:
add_filter('iamntz/page-siblings/add-hierarchy-column-filter', function() { return 'parents_only'; })

For my-custom-post-type:
// The allowed values are `all` and `parents_only`.
add_filter('iamntz/page-siblings/hierarchy-column-filter-default/post-type=my-custom-post-type', function() { return 'parents_only'; })

延伸相關外掛

文章
Filter
Apply Filters
Mastodon