diff --git a/wp-includes/template-functions-post.php b/wp-includes/template-functions-post.php index ccd8cd6173..fc2bdc40f3 100644 --- a/wp-includes/template-functions-post.php +++ b/wp-includes/template-functions-post.php @@ -314,4 +314,30 @@ function the_meta() { } } + +// +// Pages +// + +function wp_list_pages($args = '') { + global $wpdb; + + // TODO: Hierarchy. + + parse_str($args, $r); + if (!isset($r['sort_column'])) $r['sort_column'] = 'title'; + if (!isset($r['sort_order'])) $r['sort_order'] = 'asc'; + + $pages = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'static' ORDER BY post_" . $r['sort_column'] . " " . $r['sort_order'] = 'asc'); + + foreach ($pages as $page) { + echo '