[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 13:46:35 UTC 2010


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

  * status:  closed => reopened
  * resolution:  invalid =>


Comment:

 I see your point, but it would still be nice if the ''start_el'' function
 could get this argument passed on by default, because now it only knows of
 this argument if the ''$args'' object passed to ''display_element'' is an
 array.. or am I missing something something there? I mean,
 ''$children_elements'' is not available to ''start_el'' in some way is it?

 for now I resorted to adding the has_children argument to the $args object
 if it is an object (in ''display_element''):

 {{{
                 //display this element
                 if ( is_array( $args[0] ) )
                         $args[0]['has_children'] = ! empty(
 $children_elements[$element->$id_field] );
                 else
                         $args[0]->has_children = ! empty(
 $children_elements[$element->$id_field] );

                 $cb_args = array_merge( array(&$output, $element, $depth),
 $args);
 }}}

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


More information about the wp-trac mailing list