[wp-trac] [WordPress Trac] #14041: Ensure a 'has_children' parameter is given to start_el

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 22 15:05:23 UTC 2010


#14041: Ensure a 'has_children' parameter is given to start_el
--------------------------+-------------------------------------------------
 Reporter:  jaapjanfrans  |        Owner:          
     Type:  enhancement   |       Status:  reopened
 Priority:  normal        |    Milestone:  3.1     
Component:  Template      |      Version:  3.0     
 Severity:  minor         |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by scribu):

  * component:  General => Template
  * milestone:  => 3.1


Comment:

 You're right, start_el() doesn't have access to $children_elements.

 Instead of altering $cb_args, a better solution would be to set a flag on
 the Walker object instead. See has_children.diff

 You could then do:

 {{{
 function start_el() {
   if ( $this->has_children ) {
     // etc.
   }
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14041#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list