Pages update and tweaks.

git-svn-id: https://develop.svn.wordpress.org/trunk@1747 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2004-10-05 08:27:13 +00:00
parent c78d172d4f
commit 9aa1ed0d11
7 changed files with 84 additions and 131 deletions

View File

@@ -707,4 +707,23 @@ function validate_current_theme() {
return true;
}
function parent_dropdown($parent = 0, $level = 0) {
global $wpdb;
$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");
if ($items) {
foreach ($items as $item) {
$pad = str_repeat(' ', $level * 3);
if ($item->ID == $current)
$current = ' selected="selected"';
else
$current = '';
echo "\n\t<option value='$item->ID'$current>$pad $item->post_title</a></option>";
parent_dropdown($item->ID, $level + 1);
}
} else {
return false;
}
}
?>