comment_type || 'trackback' == $comment->comment_type ) && $args['short_ping'] ) { ob_start(); $this->ping( $comment, $depth, $args ); $output .= ob_get_clean(); } elseif ( 'html5' === $args['format'] ) { ob_start(); if ( !empty( $args['has_children'] ) ) { $this->start_parent_html5_comment( $comment, $depth, $args ); } else { $this->html5_comment( $comment, $depth, $args ); } $output .= ob_get_clean(); } else { ob_start(); $this->comment( $comment, $depth, $args ); $output .= ob_get_clean(); } } /** * Ends the element output, if needed. * * This ends the comment. Will check if the comment has children or is a stand-alone comment. * * @access public * @since 0.1.0 * * @see Walker::end_el() * @see wp_list_comments() * * @param string $output Passed by reference. Used to append additional content. * @param WP_Comment $comment The comment object. Default current comment. * @param int $depth Depth of comment. * @param array $args An array of arguments. */ public function end_el( &$output, $comment, $depth = 0, $args = array() ) { if ( !empty( $args['end-callback'] ) ) { ob_start(); call_user_func( $args['end-callback'], $comment, $args, $depth ); $output .= ob_get_clean(); return; } if ( !empty( $args['has_children'] ) && 'html5' === $args['format']) { ob_start(); $this->end_parent_html5_comment( $comment, $depth, $args ); $output .= ob_get_clean(); } else { if ( 'div' == $args['style'] ) { $output .= "\n"; } else { $output .= "\n"; } } } /** * Output the beginning of a parent comment in the HTML5 format. * * Bootstrap media element requires child comments to be nested within the parent media-body. * The original comment walker writes the entire comment at once, this method writes the opening * of a parent comment so children comments can be nested within. * * @access protected * @since 0.1.0 * * @see http://getbootstrap.com/components/#media * @see wp_list_comments() * * @param object $comment Comment to display. * @param int $depth Depth of comment. * @param array $args An array of arguments. */ protected function start_parent_html5_comment( $comment, $depth, $args ) { $this->html5_comment( $comment, $depth, $args, $is_parent = true ); } /** * Output a comment in the HTML5 format. * * @access protected * @since 0.1.0 * * @see wp_list_comments() * * @param object $comment Comment to display. * @param int $depth Depth of comment. * @param array $args An array of arguments. * @param boolean $is_parent Flag indicating whether or not this is a parent comment */ protected function html5_comment( $comment, $depth, $args, $is_parent = false ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; $type = get_comment_type(); $comment_classes = array(); $comment_classes[] = 'media'; // if it's a parent if ( $this->has_children ) { $comment_classes[] = 'parent'; $comment_classes[] = 'has-children'; } // if it's a child if ( $comment->comment_parent > 0 ) { $comment_classes[] = 'child'; $comment_classes[] = 'has-parent'; $comment_classes[] = 'parent-' . $comment->comment_parent; } $comment_classes = apply_filters( 'wp_bootstrap_comment_class', $comment_classes, $comment, $depth, $args ); $class_str = implode(' ', $comment_classes); ?> < id="comment-" >
get_comment_author_avatar( $comment, $args ); ?>
comment_approved ) : ?>

comment_reply_link( $comment, $depth, $args, $add_below = 'reply-comment' ); ?>
> < id="comment-" >
%2$s', esc_url($comment_author_url), $avatar_string ); }; return $avatar_string; } /** * Displays the HTML content for reply to comment link. * * @access protected * @since 0.1.0 * * @param object $comment Comment being replied to. Default current comment. * @param int $depth Depth of comment. * @param array $args An array of arguments for the Walker Object * @param string $add_below The id of the element where the comment form will be placed */ protected function comment_reply_link( $comment, $depth, $args, $add_below = 'div-comment' ) { $type = get_comment_type(); if ( 'pingback' === $type || 'trackback' === $type ) { return; } comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '
', 'after' => '
' ) ) ); } } endif;