diff -r c7c34916027a -r 177826044cd9 wp/wp-includes/class-walker-comment.php --- a/wp/wp-includes/class-walker-comment.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-includes/class-walker-comment.php Mon Oct 14 18:28:13 2019 +0200 @@ -35,7 +35,10 @@ * @see Walker::$db_fields * @todo Decouple this */ - public $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID'); + public $db_fields = array( + 'parent' => 'comment_parent', + 'id' => 'comment_ID', + ); /** * Starts the list before the elements are added. @@ -126,11 +129,12 @@ * @param string $output Used to append additional content. Passed by reference. */ public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { - if ( !$element ) + if ( ! $element ) { return; + } $id_field = $this->db_fields['id']; - $id = $element->$id_field; + $id = $element->$id_field; parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); @@ -139,9 +143,10 @@ * and display them at this level. This is to prevent them being orphaned to the end * of the list. */ - if ( $max_depth <= $depth + 1 && isset( $children_elements[$id]) ) { - foreach ( $children_elements[ $id ] as $child ) + if ( $max_depth <= $depth + 1 && isset( $children_elements[ $id ] ) ) { + foreach ( $children_elements[ $id ] as $child ) { $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output ); + } unset( $children_elements[ $id ] ); } @@ -167,9 +172,9 @@ public function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) { $depth++; $GLOBALS['comment_depth'] = $depth; - $GLOBALS['comment'] = $comment; + $GLOBALS['comment'] = $comment; - if ( !empty( $args['callback'] ) ) { + if ( ! empty( $args['callback'] ) ) { ob_start(); call_user_func( $args['callback'], $comment, $args, $depth ); $output .= ob_get_clean(); @@ -205,16 +210,17 @@ * @param array $args Optional. An array of arguments. Default empty array. */ public function end_el( &$output, $comment, $depth = 0, $args = array() ) { - if ( !empty( $args['end-callback'] ) ) { + if ( ! empty( $args['end-callback'] ) ) { ob_start(); call_user_func( $args['end-callback'], $comment, $args, $depth ); $output .= ob_get_clean(); return; } - if ( 'div' == $args['style'] ) + if ( 'div' == $args['style'] ) { $output .= "\n"; - else + } else { $output .= "\n"; + } } /** @@ -230,12 +236,12 @@ */ protected function ping( $comment, $depth, $args ) { $tag = ( 'div' == $args['style'] ) ? 'div' : 'li'; -?> + ?> < id="comment-" >