Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#10977 closed defect (bug) (fixed)

wp_list_pages() puts leading comma in exclude string

Reported by: kevinb's profile kevinB Owned by:
Milestone: 2.9 Priority: low
Severity: minor Version: 2.8.4
Component: Template Keywords: has-patch
Focuses: Cc:

Description

When called with no 'exclude' argument, wp_list_pages() passes an array with a nullstring element to the filter 'list_pages_excludes'. If a plugin then adds at least one more element to that array, the result is a leading comma in the 'exclude' argument string which is passed to get_pages() and walk_page_tree().

This misplaced comma does not affect WP core behavior. But if a plugin which filters 'get_pages' copies the 'exclude' argument to 'exclude_tree' (logical enough if depth=1 is also passed) and mimics core handling of that argument, the result is exclusion of the Main Page (ID zero) and all its children.

Attachments (1)

wp_list_pages-no_leading_exclude_comma.patch (774 bytes) - added by kevinB 14 years ago.
wp_list_pages(): prevent leading comma in exclude argument

Download all attachments as: .zip

Change History (3)

@kevinB
14 years ago

wp_list_pages(): prevent leading comma in exclude argument

#1 @scribu
14 years ago

  • Keywords has-patch added

#2 @markjaquith
14 years ago

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

(In [12327]) Get rid of stray comma. fixes #10977. props kevinB

Note: See TracTickets for help on using tickets.