get_pages function: number and child_of parameters conflict — at Version 10
|Reported by:||ortsaipekim||Owned by:||ryan|
|Component:||Posts, Post Types||Keywords:||has-patch needs-testing|
Description (last modified by SergeyBiryukov)
Passing both number and child_of parameters to get_pages will produce nonsensical results.
Within the function number is used first to limit the number of results, then child_of is used to establish results within a certain hierarchical scope.
So with a structure of:
Parent 1 Parent 2 Parent 3 Child 1 Child 2 Child 3
passing a number=2 and child_of=(parent 3 id) will not give the expected output. In this case, the result will first be limited to only include:
Parent 1 Parent 2
so the child_of will be ignored. To produce a more logical result, child_of should be evaluated first, then number should be evaluated to limit the result set.
Change History (11)
- Component changed from General to Query
- Milestone changed from 2.8.1 to 2.9
- Owner set to ryan
- Keywords needs-testing added; get_pages wp_list_pages removed
- Milestone changed from 3.0 to Future Release