Allow queries by post type. Enable paging in Manage->Pages

git-svn-id: http://svn.automattic.com/wordpress/trunk@3564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2006-02-21 08:39:58 +00:00
parent 29540c8e2b
commit b4166c403b
4 changed files with 66 additions and 87 deletions
+15 -15
View File
@@ -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';
?>
<tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'>
<th scope="row"><?php echo $post->ID; ?></th>
@@ -670,12 +675,7 @@ function page_rows($parent = 0, $level = 0, $pages = 0) {
</tr>
<?php
page_rows($id, $level +1, $pages);
}
}
} else {
return false;
if ( $hierarchy) page_rows($id, $level + 1, $pages);
}
}