Index: wp-admin/includes/nav-menu.php
===================================================================
--- wp-admin/includes/nav-menu.php (revision 17724)
+++ wp-admin/includes/nav-menu.php (working copy)
@@ -207,6 +207,21 @@
* @uses Walker_Nav_Menu
*/
class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
+ function __construct( $fields = false ) {
+ if( $fields ) {
+ $this->db_fields = $fields;
+ }
+ }
+
+ function start_lvl( &$output, $depth ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "\n$indent
\n";
+ }
+
+ function end_lvl( &$output, $depth ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "\n$indent
";
+ }
/**
* @see Walker::start_el()
@@ -613,8 +628,13 @@
if ( !$posts )
$error = ''. $post_type['args']->labels->not_found .'';
+
+ $db_fields = false;
+ if( is_post_type_hierarchical( $post_type_name ) ) {
+ $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
+ }
- $walker = new Walker_Nav_Menu_Checklist;
+ $walker = new Walker_Nav_Menu_Checklist( $db_fields );
$current_tab = 'most-recent';
if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) {
@@ -716,6 +736,7 @@
'object_id' => $_nav_menu_placeholder,
'post_content' => '',
'post_excerpt' => '',
+ 'post_parent' => '',
'post_title' => _x('Home', 'nav menu home label'),
'post_type' => 'nav_menu_item',
'type' => 'custom',
@@ -820,8 +841,13 @@
'total' => $num_pages,
'current' => $pagenum
));
+
+ $db_fields = false;
+ if( is_taxonomy_hierarchical( $taxonomy_name ) ) {
+ $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' );
+ }
- $walker = new Walker_Nav_Menu_Checklist;
+ $walker = new Walker_Nav_Menu_Checklist( $db_fields );
$current_tab = 'most-used';
if ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && in_array( $_REQUEST[$taxonomy_name . '-tab'], array('all', 'most-used', 'search') ) ) {