Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1940 closed defect (bug) (fixed)

Problme with wp_list_pages exclude option

Reported by: SteveAgl Owned by:
Milestone: Priority: normal
Severity: major Version: 1.6
Component: Administration Keywords:
Focuses: Cc:


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)

#1 @matt
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3217]) Return if not an array, fixes #1940

#2 @(none)
15 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.