Changeset 17796
- Timestamp:
- 05/04/2011 06:59:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/nav-menu.php
r17143 r17796 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 } 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 } 210 225 211 226 /** … … 614 629 if ( !$posts ) 615 630 $error = '<li id="error">'. $post_type['args']->labels->not_found .'</li>'; 616 617 $walker = new Walker_Nav_Menu_Checklist; 631 632 $db_fields = false; 633 if ( is_post_type_hierarchical( $post_type_name ) ) { 634 $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' ); 635 } 636 637 $walker = new Walker_Nav_Menu_Checklist( $db_fields ); 618 638 619 639 $current_tab = 'most-recent'; … … 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', … … 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 } 849 850 $walker = new Walker_Nav_Menu_Checklist( $db_fields ); 825 851 826 852 $current_tab = 'most-used';
Note: See TracChangeset
for help on using the changeset viewer.