Ticket #14041: 14041.diff
File 14041.diff, 2.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-walker.php
40 40 protected $max_pages = 1; 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 * 45 54 * @since 4.0.0 … … 172 181 return; 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 194 182 $id = $element->$id_field;183 184 195 // descend only when the depth is right and there are childrens for this element 185 196 if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) { 186 197 -
src/wp-includes/comment-template.php
1786 1786 $add_below = 'div-comment'; 1787 1787 } 1788 1788 ?> 1789 <<?php echo $tag; ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?> id="comment-<?php comment_ID(); ?>">1789 <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '' ); ?> id="comment-<?php comment_ID(); ?>"> 1790 1790 <?php if ( 'div' != $args['style'] ) : ?> 1791 1791 <div id="div-comment-<?php comment_ID(); ?>" class="comment-body"> 1792 1792 <?php endif; ?> … … 1832 1832 protected function html5_comment( $comment, $depth, $args ) { 1833 1833 $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; 1834 1834 ?> 1835 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>>1835 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '' ); ?>> 1836 1836 <article id="div-comment-<?php comment_ID(); ?>" class="comment-body"> 1837 1837 <footer class="comment-meta"> 1838 1838 <div class="comment-author vcard">