Ticket #24587: 24587.patch
| File 24587.patch, 1.6 KB (added by , 10 years ago) |
|---|
-
class-walker-nav-menu.php
246 246 } 247 247 $output .= "</li>{$n}"; 248 248 } 249 249 public function factory_element($element){ 250 251 if(!($element instanceof WP_Post && $element->post_type =='nav_menu_item')){ 252 $element= wp_setup_nav_menu_item($element); 253 } 254 255 return $element; 256 } 257 public function factory_args($args){ 258 //$wp_nav_menu_args = array_shift($args); 259 if(is_array($args)){ 260 $args=(object)$args; 261 } 262 // array_unshift($args, $wp_nav_menu_args); 263 return $args; 264 } 250 265 } // Walker_Nav_Menu -
class-wp-walker.php
143 143 } 144 144 145 145 $cb_args = array_merge( array(&$output, $element, $depth), $args); 146 $cb_args[3]= $this->factory_args($cb_args[3]); 147 $element= $this->factory_element($element); 146 148 call_user_func_array(array($this, 'start_el'), $cb_args); 147 149 148 150 // descend only when the depth is right and there are childrens for this element … … 153 155 if ( !isset($newlevel) ) { 154 156 $newlevel = true; 155 157 //start the child delimiter 158 156 159 $cb_args = array_merge( array(&$output, $depth), $args); 157 160 call_user_func_array(array($this, 'start_lvl'), $cb_args); 158 161 } … … 421 424 422 425 unset( $children_elements[ $id ] ); 423 426 } 427 public function factory_element($element){ 428 429 430 return $element; 431 } 432 public function factory_args($args){ 424 433 434 return $args; 435 } 436 425 437 } // Walker
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)