get_pages with child_of only works with uninterrupted hierarchies
|Reported by:||vividvisions||Owned by:|
I have a page X with several children and grandchildren. Some of the grandchildren have a certain meta key and value. I now want to fetch all pages under page X that have this meta key. After reading the documentation of get_pages, I expected this to work with a single call of get_pages.
But if I use get_pages like this:
it returns no pages at all (hierarchical=0 has no effect). It seems that's because child_of triggers a call of get_page_children which only returns uninterrupted hierarchies. Since the query returns only some grandchildren and no direct descendants, the function fails. IMHO, that's a bug.
Change History (7)
- Keywords needs-patch added; cms get_pages get_page_children removed
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to enhancement
comment:2 wonderboymusic — 4 months ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 3.7