WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#4509 closed defect (bug) (wontfix)

Add parameters to wp_list_pages defaults

Reported by: MichaelH Owned by:
Milestone: Priority: low
Severity: minor Version: 2.3
Component: Administration Keywords:
Focuses: Cc:
PR Number:

Description

Add parameters to wp_list_pages default values to 'document' what can be used (passed to get_pages).

Attachments (1)

4509.diff (638 bytes) - added by MichaelH 12 years ago.
Adds sort_order, hierarchical, include, meta_key, and meta_value

Download all attachments as: .zip

Change History (4)

@MichaelH
12 years ago

Adds sort_order, hierarchical, include, meta_key, and meta_value

#1 follow-up: @Otto42
12 years ago

-1. Functions should only define as defaults what they actually use themselves. A default should not be added because a lower level function (get_pages in this case) uses it. Those defaults should be in get_pages instead.

The idea is that parameters can pass through to lower level functions, yes, but you don't have to add the defaults to higher level functions to do that unless there's a parameter naming conflict of some sort.

Leave documentation in the codex where it belongs. Don't document the code unless you're doing it with comments.

#2 in reply to: ↑ 1 @MichaelH
12 years ago

  • Keywords has-patch added

Replying to Otto42:

Leave documentation in the codex where it belongs. Don't document the code unless you're doing it with comments.

That's the reason for the patch--in trying to document that Template Tag for Codex, had to dig not only into the wp_list_pages function, but then list_pages, just to find the defaults.

#3 @Nazgul
12 years ago

  • Keywords has-patch removed
  • Resolution set to wontfix
  • Status changed from new to closed

I agree with Otto42. Documentation should be done in Codex.

Although I do agree that it's usefull information to know if you plan on using wp_list_pages, so adding it to http://codex.wordpress.org/wp_list_pages would be great.

Note: See TracTickets for help on using tickets.