Opened 20 months ago
Last modified 20 months ago
#18848 assigned feature request
Filter post listing screen by post parent
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Administration | Version: | 3.3 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
It's not possible to filter a post listing screen by post_parent. This would be super handy for hierarchical post types (eg. Pages) where you may have several levels of hierarchy and want to view only the descendants of a particular page. I'm not sure that we need a UI (eg. dropdown menu) for it, but a working URL query var would be great.
I made an attempt at patching this a while ago using the child_of parameter but it got complicated quite quickly, so I'm putting it out there as a feature request in case anyone feels like tackling it.
Attachments (2)
Change History (6)
comment:2
in reply to:
↑ 1
johnbillion — 20 months ago
Replying to nacin:
Attached patch should probably do the trick.
Indeed it does but it doesn't include all descendants, just immediate children of the given post_parent. I think to achieve this, WP_Query's get_posts() needs to be patched to support the child_of parameter in the same way get_pages() does.
johnbillion — 20 months ago
comment:3
johnbillion — 20 months ago
Attached patch adds support for the child_of parameter to get_posts() and allows us to query a posts screen using the child_of query var in addition to the post_parent query var. We just need to tidy up the post listing when this is used.
comment:4
johnbillion — 20 months ago
- Owner set to johnbillion
- Status changed from new to assigned

Attached patch should probably do the trick.