Changeset 3564 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 02/21/2006 08:39:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r3563 r3564 644 644 } 645 645 646 function page_rows($parent = 0, $level = 0, $pages = 0 ) {646 function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true) { 647 647 global $wpdb, $class, $post; 648 648 649 if (!$pages) 649 650 $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order"); 650 651 651 if ($pages) { 652 foreach ($pages as $post) { 653 start_wp(); 654 if ($post->post_parent == $parent) { 655 $post->post_title = wp_specialchars($post->post_title); 656 $pad = str_repeat('— ', $level); 657 $id = $post->ID; 658 $class = ('alternate' == $class) ? '' : 'alternate'; 652 if (! $pages) 653 return false; 654 655 foreach ($pages as $post) { 656 setup_postdata($post); 657 if ( $hierarchy && ($post->post_parent != $parent) ) 658 continue; 659 660 $post->post_title = wp_specialchars($post->post_title); 661 $pad = str_repeat('— ', $level); 662 $id = $post->ID; 663 $class = ('alternate' == $class) ? '' : 'alternate'; 659 664 ?> 660 665 <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> … … 671 676 672 677 <?php 673 674 page_rows($id, $level +1, $pages); 675 } 676 } 677 } else { 678 return false; 678 if ( $hierarchy) page_rows($id, $level + 1, $pages); 679 679 } 680 680 }
Note: See TracChangeset
for help on using the changeset viewer.