balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

comments-modifications.php (2551B)


      1 <?php
      2 /**
      3  * Custom Comment Area Modification
      4  * @package Appside
      5  * @since 1.0.0
      6  */
      7 if ( ! defined( 'ABSPATH' ) ) {
      8 	exit; // Exit if accessed directly.
      9 }
     10 
     11 if ( ! function_exists( 'appside_comment_modification' ) ) {
     12 	function appside_comment_modification($comment, $args, $depth) {
     13 		$GLOBALS['comment'] = $comment;
     14 		extract($args, EXTR_SKIP);
     15 		if ( 'div' == $args['style'] ) {
     16 			$tag = 'div';
     17 			$add_below = 'comment';
     18 		} else {
     19 			$tag = 'li';
     20 			$add_below = 'div-comment';
     21 		}
     22 		$comment_class = empty( $args['has_children'] ) ? '' : 'parent';
     23 		?>
     24 
     25 		<<?php echo esc_attr($tag); ?> <?php comment_class('item ' . $comment_class .' ' ); ?> id="comment-<?php comment_ID() ?>">
     26 		<?php if ( 'div' != $args['style'] ) : ?>
     27 			<div id="div-comment-<?php comment_ID() ?>" class="">
     28 		<?php endif; ?>
     29 
     30 
     31 		<div class="single-comment-wrap"><!-- single comment wrap -->
     32             <?php if(get_comment_type(get_comment_ID()) == 'comment'):?>
     33 			<div class="thumb">
     34 				<?php
     35 				if ( $args['avatar_size'] != 0 ) {
     36 					echo get_avatar( $comment, 80 );
     37 				}
     38 				?>
     39 
     40 			</div>
     41             <?php endif;?>
     42 			<div class="content">
     43 				<h4 class="title"><?php printf( '%s', get_comment_author() ); ?></h4>
     44 				<?php if ( $comment->comment_approved == '0' ) : ?>
     45 					<em class="comment-awaiting-moderation"><?php echo esc_html__( 'Your comment is awaiting moderation.', 'aapside' ); ?></em>
     46 				<?php endif; ?>
     47 				<div class="comment-content">
     48                     <ul class="xg-comments-meta">
     49                         <li class="comment-date">
     50                             <?php
     51                             printf('<span class="date">%s</span>',get_comment_date('d M Y'));
     52                             ?>
     53                         </li>
     54                         <li class="comment-reply-link">
     55                             <?php
     56                             comment_reply_link( array_merge( $args, array(
     57                                 'reply_text' => esc_html__('Reply','aapside') ,
     58                                 'before' => '',
     59                                 'class'  => '',
     60                                 'depth' => $depth,
     61                                 'max_depth' => $args['max_depth']
     62                             ) ) );
     63                             ?>
     64                         </li>
     65                     </ul>
     66 					<?php comment_text(); ?>
     67 				</div>
     68 			</div>
     69 		</div><!-- //. single comment wrap -->
     70 		<?php if ( 'div' != $args['style'] ) : ?>
     71 			</div>
     72 		<?php endif;
     73 	}
     74 }