[wp-hackers] wp_list_pages

Ryan Boren ryan at boren.nu
Thu Dec 16 23:31:03 UTC 2004

On Sat, 2004-12-11 at 17:47 +0100, Adi Sieker wrote:
> Chris Waigl wrote:
> >
> >
> > Oops you're fast -- I only saw that you're working on this a few hours
> hehe, I got some extra free time in. :)
> >
> > I'm still a very basic-level coder, but it happens that I slightly
rewrote the existing function, too. No hierarchies, but there are two
things I don't think you did: a) add a class "current" to the list
item of the current page (for menu styling) and remove the hyperlink
from that item and
> OK, that sounds good. I'll see how that fits in best with what I have
>  > b) an option not to print but to return an array of
> > pages.
> I think I'd rather split the function in this case. So
> we'd have one get_list_pages which returns the array
> and one wp_list_pages which returns the formatted list and
> which uses get_list_pages. I think that naming scheme also fits
> in with the API rules RyanB suggested a while back.

I committed Adi's original function with one small change.  I collapsed
optiondates and modifieddate into one option, show_date, which can be set
to 'created' or 'modified'.

Next we can integrate Chris' 'current' code and split into wp_list_pages
() and get_page_list().  How's that sound?


More information about the hackers mailing list