[wp-cvs] wordpress/wp-includes template-functions-post.php, 1.29, 1.30

Ryan Boren rboren at users.sourceforge.net
Sat Oct 9 02:03:40 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5404

Modified Files:
	template-functions-post.php 
Log Message:
wp_list_pages(), first draft

Index: template-functions-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-post.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** template-functions-post.php	8 Aug 2004 20:22:29 -0000	1.29
--- template-functions-post.php	9 Oct 2004 02:03:37 -0000	1.30
***************
*** 315,317 ****
--- 315,343 ----
  }
  
+ 
+ //
+ // 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 '<li>';
+ 
+ 		$title = apply_filters('the_title', $page->post_title);
+ 
+ 		echo '<a href="' . get_page_link($page->ID) . '" title="' . htmlspecialchars($title) . '">' . $title . '</a>';
+ 		echo '</li>';
+ 	}
+ }
+ 
  ?>
\ No newline at end of file




More information about the cvs mailing list