Changeset 28824
- Timestamp:
- 06/24/2014 05:05:56 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-walker.php
r28524 r28824 41 41 42 42 /** 43 * Wether the current element has children or not. To be used in start_el() 44 * 45 * @since 4.0.0 46 * @var bool 47 * @access protected 48 */ 49 protected $has_children; 50 51 /** 43 52 * Make private properties readable for backwards compatibility 44 53 * … … 173 182 174 183 $id_field = $this->db_fields['id']; 184 $id = $element->$id_field; 175 185 176 186 //display this element 177 if ( isset( $args[0] ) && is_array( $args[0] ) ) 178 $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] ); 187 $this->has_children = ! empty( $children_elements[ $id ] ); 188 if ( isset( $args[0] ) && is_array( $args[0] ) ) { 189 $args[0]['has_children'] = $this->has_children; // Backwards compatibility. 190 } 191 179 192 $cb_args = array_merge( array(&$output, $element, $depth), $args); 180 193 call_user_func_array(array($this, 'start_el'), $cb_args); 181 182 $id = $element->$id_field;183 194 184 195 // descend only when the depth is right and there are childrens for this element -
trunk/src/wp-includes/comment-template.php
r28813 r28824 1785 1785 } 1786 1786 ?> 1787 <<?php echo $tag; ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?> id="comment-<?php comment_ID(); ?>">1787 <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '' ); ?> id="comment-<?php comment_ID(); ?>"> 1788 1788 <?php if ( 'div' != $args['style'] ) : ?> 1789 1789 <div id="div-comment-<?php comment_ID(); ?>" class="comment-body"> … … 1831 1831 $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; 1832 1832 ?> 1833 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>>1833 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '' ); ?>> 1834 1834 <article id="div-comment-<?php comment_ID(); ?>" class="comment-body"> 1835 1835 <footer class="comment-meta">
Note: See TracChangeset
for help on using the changeset viewer.