From 5d40bf562cf692efb1a78bf0cf86204df0536931 Mon Sep 17 00:00:00 2001 From: rob1n Date: Fri, 18 May 2007 02:29:11 +0000 Subject: [PATCH] Texturize and autop the text widgets, and allow pages to be sorted by a specified field. Props Denis de Bernardy. see #4259 git-svn-id: http://svn.automattic.com/wordpress/trunk@5486 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 56 +++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 8ceec9e27d..1ca75dd9fe 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -326,19 +326,43 @@ function wp_get_widget_defaults() { /* Default Widgets */ -function wp_widget_pages($args) { - extract($args); - $options = get_option('widget_pages'); - $title = empty($options['title']) ? __('Pages') : $options['title']; - echo $before_widget . $before_title . $title . $after_title . "\n" . $after_widget; +function wp_widget_pages( $args ) { + extract( $args ); + $options = get_option( 'widget_pages' ); + + $title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title']; + $sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby']; + + if ( $sortby == 'menu_order' ) { + $sortby = 'menu_order, post_title'; + } + + $out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby ); + + if ( !empty( $out ) ) { +?> + + + + +

+

- +
- " name="text-title-" type="text" value="" /> - + + " name="text-submit-" value="1" />