mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Pages update and tweaks.
git-svn-id: https://develop.svn.wordpress.org/trunk@1747 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user