Changeset 2480 for trunk/wp-includes/template-functions-post.php
- Timestamp:
- 03/27/2005 10:17:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-post.php
r2479 r2480 251 251 // 252 252 253 function &get_page_children($page_id, &$pages) { 254 global $page_cache; 255 256 if ( empty($pages) ) 257 $pages = &$page_cache; 258 259 $page_list = array(); 260 foreach ($pages as $page) { 261 if ($page->post_parent == $page_id) { 262 $page_list[] = $page; 263 if ( $children = get_page_children($page->ID, $pages)) { 264 $page_list = array_merge($page_list, $children); 265 } 266 } 267 } 268 269 return $page_list; 270 } 271 253 272 function &get_pages($args = '') { 254 global $wpdb , $page_cache;273 global $wpdb; 255 274 256 275 parse_str($args, $r); … … 270 289 } 271 290 272 $post_parent = '';273 if ($r['child_of']) {274 $post_parent = ' AND post_parent=' . $r['child_of'] . ' ';275 }276 277 291 $pages = $wpdb->get_results("SELECT * " . 278 292 "FROM $wpdb->posts " . 279 293 "WHERE post_status = 'static' " . 280 "$post_parent" .281 294 "$exclusions " . 282 295 "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']); … … 287 300 // Update cache. 288 301 update_page_cache($pages); 302 303 if ($r['child_of']) 304 $pages = & get_page_children($r['child_of'], $pages); 289 305 290 306 return $pages;
Note: See TracChangeset
for help on using the changeset viewer.