otw_comments

The Carbon Light - Business responsive otw comments function.

Description

otw_comments( $comment, $args, $depth ); 

Parameters (3)

0. $comment
The comment.
1. $args
The args.
2. $depth
The depth.

Usage

  1. if ( !function_exists( 'otw_comments' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The comment. 
  5. $comment = null; 
  6.  
  7. // The args. 
  8. $args = null; 
  9.  
  10. // The depth. 
  11. $depth = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = otw_comments($comment, $args, $depth); 
  15.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function otw_comments($comment, $args, $depth) 
  2. $GLOBALS['comment'] = $comment; 
  3. extract($args, EXTR_SKIP); 
  4.  
  5. if ( 'div' == $args['style'] ) { 
  6. $tag = 'div'; 
  7. $add_below = 'comment'; 
  8. } else { 
  9. $tag = 'li'; 
  10. $add_below = 'div-comment'; 
  11. ?> 
  12. <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>"> 
  13. <?php if ( 'div' != $args['style'] ) : ?> 
  14. <div id="div-comment-<?php comment_ID() ?>" class="comment-wrapper animate-on-hover"> 
  15. <?php endif; ?> 
  16. <a class="image" href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, 60 ); ?></a> 
  17. <div class="comment-body"> 
  18. <span class="comment-meta"><?php echo get_comment_author( $comment->comment_ID ); ?></span> <span class="post-date"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"> 
  19. <?php printf( __('%1$s at %2$s', 'otw-carbon-light'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)', 'otw-carbon-light'), ' ', '' ); ?></span> 
  20.  
  21. <div class="comment-body-text"> 
  22.  
  23. <?php if ($comment->comment_approved == '0') : ?> 
  24. <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'otw-carbon-light') ?></em> 
  25. <br /> 
  26. <?php endif; ?> 
  27.  
  28. <?php comment_text() ?> 
  29. </div> 
  30. <div class="comment-reply"><?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div> 
  31. </div> 
  32. <?php if ( 'div' != $args['style'] ) : ?> 
  33. </div> 
  34. <?php endif; ?> 
  35. <?php }