#1940 closed defect (bug) (fixed)
Problme with wp_list_pages exclude option
| Reported by: | SteveAgl | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 1.6 |
| Severity: | major | Keywords: | |
| Cc: | Focuses: |
Description
If you exclude one page and this it's the only page or it's the only top level page in a gerarchy, the functions generate an error:
Warning: Invalid argument supplied for foreach() in F:\Test\wp-includes\template-functions-post.php on line 406
Example: have this structure of pages, this pages only (ID of pages are between brackets their values are random no matter what they are)
Mother1 (10)
- Child1 (20)
- Child2 (21)
- Child3 (23)
In a theme put:
<?php wp_list_pages('exclude=10&title_li=<h2>Pages</h2>' ); ?>
ANd you get the error, if you add another page like Mother2 (28) this page will be dispalied and all it's ok. (show in 1.5.2 too)
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [3217]) Return if not an array, fixes #1940