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.