[wp-hackers] Improving the Pages widget

Edward Dale scompt at scompt.com
Mon Jan 12 16:06:18 GMT 2009

In a couple WordPress installs, I've wanted to use the Pages widget to
display the page navigation in the sidebar, but only wanted to go down a
certain depth.  Unfortunately, the widget doesn't support that option of
wp_list_pages, so I've either resorted to copying the code to my
functions.php file and modifying it or installing one of the plugins that
been developed to fill the need [1,2,3,4].  Either way, it seems a bit
heavy-handed for a simple "depth=1".
I propose adding a filter on line 681 of widgets.php to the options that are
passed into wp_list_pages.  This would leave the main functionality the
same, but would allow power users and developers to customize the widget
width resorting to the methods I described above.  This is already done on
line 752 for the Links widget.

What do you all think?


[1] http://wordpress.org/extend/plugins/flexi-pages-widget/
[2] http://wordpress.org/extend/plugins/subpages-widget/

More information about the wp-hackers mailing list