From 433d32693df5a6957c577fde7383c2d8174fc06e Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 21 Feb 2006 12:59:22 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@532 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-admin/admin-functions.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'wp-inst/wp-admin/admin-functions.php') diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php index 81ffe2d..aabf77e 100644 --- a/wp-inst/wp-admin/admin-functions.php +++ b/wp-inst/wp-admin/admin-functions.php @@ -643,19 +643,24 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) { } } -function page_rows($parent = 0, $level = 0, $pages = 0) { +function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true) { global $wpdb, $class, $post; + if (!$pages) $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order"); - if ($pages) { - foreach ($pages as $post) { - start_wp(); - if ($post->post_parent == $parent) { - $post->post_title = wp_specialchars($post->post_title); - $pad = str_repeat('— ', $level); - $id = $post->ID; - $class = ('alternate' == $class) ? '' : 'alternate'; + if (! $pages) + return false; + + foreach ($pages as $post) { + setup_postdata($post); + if ( $hierarchy && ($post->post_parent != $parent) ) + continue; + + $post->post_title = wp_specialchars($post->post_title); + $pad = str_repeat('— ', $level); + $id = $post->ID; + $class = ('alternate' == $class) ? '' : 'alternate'; ?> ID; ?> @@ -665,17 +670,12 @@ function page_rows($parent = 0, $level = 0, $pages = 0) { post_modified); ?> - " . __('Edit') . ""; } ?> - " . __('Delete') . ""; } ?> + " . __('Edit') . ""; } ?> + " . __('Delete') . ""; } ?>