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" />