Make WordPress Core

Opened 13 years ago

Closed 4 years ago

#18848 closed feature request (maybelater)

Filter post listing screen by post parent

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: Posts, Post Types Keywords: needs-patch needs-unit-tests
Focuses: administration Cc:


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)

18848.diff (1.4 KB) - added by nacin 13 years ago.
18848.2.patch (2.1 KB) - added by johnbillion 13 years ago.

Download all attachments as: .zip

Change History (9)

#1 follow-up: @nacin
13 years ago

Attached patch should probably do the trick.

13 years ago

#2 in reply to: ↑ 1 @johnbillion
13 years 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.

#3 @johnbillion
13 years 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.

#4 @johnbillion
13 years ago

  • Owner set to johnbillion
  • Status changed from new to assigned

#5 @jeremyfelt
10 years ago

  • Component changed from Administration to Posts, Post Types
  • Focuses admin added

#6 @chriscct7
9 years ago

  • Keywords needs-patch needs-unit-tests added

#7 @johnbillion
4 years ago

  • Resolution set to maybelater
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.