[wp-trac] [WordPress Trac] #15667: wp_list_pages, if it finds no pages to display, shows random child pages instead because of a bug in get_pages() (was: wp_list_pages, if it finds no pages to display, shows random child pages instead)
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 16 05:09:28 UTC 2011
#15667: wp_list_pages, if it finds no pages to display, shows random child pages
instead because of a bug in get_pages()
---------------------------------------+-----------------------------
Reporter: bobsoap | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version: 3.0.2
Severity: critical | Resolution:
Keywords: wp_list_pages needs-patch |
---------------------------------------+-----------------------------
Changes (by mdawaffe):
* keywords: wp_list_pages => wp_list_pages needs-patch
* milestone: Awaiting Review => Future Release
Comment:
It looks like the problem is that {{{get_pages()}}} is returning the
incorrect pages in all exclude situations, but the page Walker orphans the
children (so doesn't display them) in most of those cases. In the ones
you list above, though, the Walker does not orphan the children because
there's no parent for it to start walking at.
The root of the problem is {{{get_pages()}}}, since the Walker's behavior
when fed bad data like this should probably be left undefined.
As a workaround, you can set parent=0.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15667#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list