1 | <?php |
||
27 | class LSX_Walker_Comment extends Walker_Comment { |
||
28 | |||
29 | function start_lvl( &$output, $depth = 0, $args = array() ) { |
||
|
|||
30 | $GLOBALS['comment_depth'] = $depth + 1; ?> |
||
31 | <ul <?php comment_class( 'media media-reply unstyled list-unstyled comment-' . get_comment_ID() ); ?>> |
||
32 | <?php |
||
33 | } |
||
34 | |||
35 | function end_lvl( &$output, $depth = 0, $args = array() ) { |
||
36 | $GLOBALS['comment_depth'] = $depth + 1; |
||
37 | echo '</ul>'; |
||
38 | } |
||
39 | |||
40 | function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) { |
||
41 | ++$depth; |
||
42 | $GLOBALS['comment_depth'] = $depth; |
||
43 | $GLOBALS['comment'] = $comment; |
||
44 | |||
45 | if ( ! empty( $args['callback'] ) ) { |
||
46 | call_user_func( $args['callback'], $comment, $args, $depth ); |
||
47 | return; |
||
48 | } |
||
49 | ?> |
||
50 | |||
51 | <li id="comment-<?php comment_ID(); ?>" <?php comment_class( 'media comment-' . get_comment_ID() ); ?>> |
||
52 | <?php get_template_part( 'comment' ); ?> |
||
53 | <?php |
||
54 | } |
||
55 | |||
56 | function end_el( &$output, $comment, $depth = 0, $args = array() ) { |
||
63 | } |
||
64 | |||
65 | } |
||
66 | |||
68 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.