Make WordPress Core


Ignore:
Timestamp:
10/05/2004 08:27:13 AM (21 years ago)
Author:
saxmatt
Message:

Pages update and tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r1715 r1747  
    708708}
    709709
     710function parent_dropdown($parent = 0, $level = 0) {
     711    global $wpdb;
     712    $items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_status = 'static' ORDER BY menu_order");
     713    if ($items) {
     714        foreach ($items as $item) {
     715            $pad = str_repeat(' ', $level * 3);
     716            if ($item->ID == $current)
     717                $current = ' selected="selected"';
     718            else
     719                $current = '';
     720
     721            echo "\n\t<option value='$item->ID'$current>$pad $item->post_title</a></option>";
     722                parent_dropdown($item->ID, $level + 1);
     723        }
     724    } else {
     725        return false;
     726    }
     727}
     728
    710729?>
Note: See TracChangeset for help on using the changeset viewer.