[wp-hackers] Dynamic walkers?
Aaron D. Campbell
aaron at xavisys.com
Thu Jan 29 18:45:25 GMT 2009
Mike Little wrote:
> 2009/1/29 Bryan Fordham <bfordham at gmail.com>:
>> So last night I wrote a simple plugin for a friend to modify how WP
>> displays pages. What I ended up doing was subclassing Walker_Page and
>> modifying walk().
>> I wanted him to still be able to use all the options from
>> wp_list_pages, but to do that I had to duplicate that method, instead
>> of calling walk_page_tree it called a function just like it, only one
>> that used my Walker class.
>> Hope that makes sense.
>> Anyway, my question is: would it be worthwhile to patch wp_get_pages
>> to accept a custom Walker class? That would have kept me from
>> duplicating code, and help avoid all the problems that entails.
>> I'm not much of a WP hacker, so this may be a bad idea, or totally
>> unnecessary, but if it's useful I can submit a patch.
> Next version will support it.
The same functionality will be added to the category walkers too:
More information about the wp-hackers