Ticket #17029: 17029.3.diff
File 17029.3.diff, 2.0 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/nav-menu.php
207 207 * @uses Walker_Nav_Menu 208 208 */ 209 209 class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { 210 function __construct( $fields = false ) { 211 if ( $fields ) { 212 $this->db_fields = $fields; 213 } 214 } 210 215 216 function start_lvl( &$output, $depth ) { 217 $indent = str_repeat( "\t", $depth ); 218 $output .= "\n$indent<ul class='children'>\n"; 219 } 220 221 function end_lvl( &$output, $depth ) { 222 $indent = str_repeat( "\t", $depth ); 223 $output .= "\n$indent</ul>"; 224 } 225 211 226 /** 212 227 * @see Walker::start_el() 213 228 * @since 3.0.0 … … 613 628 614 629 if ( !$posts ) 615 630 $error = '<li id="error">'. $post_type['args']->labels->not_found .'</li>'; 631 632 $db_fields = false; 633 if ( is_post_type_hierarchical( $post_type_name ) ) { 634 $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' ); 635 } 616 636 617 $walker = new Walker_Nav_Menu_Checklist ;637 $walker = new Walker_Nav_Menu_Checklist( $db_fields ); 618 638 619 639 $current_tab = 'most-recent'; 620 640 if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) { … … 716 736 'object_id' => $_nav_menu_placeholder, 717 737 'post_content' => '', 718 738 'post_excerpt' => '', 739 'post_parent' => '', 719 740 'post_title' => _x('Home', 'nav menu home label'), 720 741 'post_type' => 'nav_menu_item', 721 742 'type' => 'custom', … … 821 842 'current' => $pagenum 822 843 )); 823 844 824 $walker = new Walker_Nav_Menu_Checklist; 845 $db_fields = false; 846 if ( is_taxonomy_hierarchical( $taxonomy_name ) ) { 847 $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' ); 848 } 825 849 850 $walker = new Walker_Nav_Menu_Checklist( $db_fields ); 851 826 852 $current_tab = 'most-used'; 827 853 if ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && in_array( $_REQUEST[$taxonomy_name . '-tab'], array('all', 'most-used', 'search') ) ) { 828 854 $current_tab = $_REQUEST[$taxonomy_name . '-tab'];