| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
global $comment; |
| 6 |
$comment = isset( $args['template_args']['comment'] ) ? $args['template_args']['comment'] : ''; |
| 7 |
$avatar_url = get_avatar_url( $comment->comment_author_email, array( 'size' => 500 ) ); |
| 8 |
?> |
| 9 |
<div class="card mb-5"> |
| 10 |
|
| 11 |
<div class="card-header"> |
| 12 |
<a href="<?php echo esc_url( get_comment_link($comment->comment_ID) ); ?>"><?php echo esc_html( get_the_title($comment->comment_post_ID) ); ?></a> |
| 13 |
</div> |
| 14 |
|
| 15 |
<div class="card-body"> |
| 16 |
<div class="row justify-content-center"> |
| 17 |
<div class="col-5 col-md-2 mb-3 col-xl-2 text-center"> |
| 18 |
<?php |
| 19 |
$args = array('class' => 'align-self-start img-thumbnail rounded-circle mx-auto d-block'); |
| 20 |
echo get_avatar($comment->user_id,'',esc_url($avatar_url),'',$args); |
| 21 |
?> |
| 22 |
<cite><?php echo uwp_get_username($comment->user_id); ?></cite> |
| 23 |
</div> |
| 24 |
<div class="col-12 col-md-10 col-xl-10 text-muted"> |
| 25 |
<?php |
| 26 |
do_action( 'uwp_before_comment_summary', $comment ); |
| 27 |
comment_text(); |
| 28 |
do_action( 'uwp_after_comment_summary', $comment ); |
| 29 |
?> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
|
| 34 |
<div class="card-footer bg-white"> |
| 35 |
<?php |
| 36 |
$footer_html = '<time class="uwp-profile-item-time published timeago" datetime="'.get_comment_time( 'c' ).'">'.date_i18n( get_option( 'date_format' ), strtotime( get_comment_date("", $comment->comment_ID) ) ).'</time>'; |
| 37 |
$footer_html .= aui()->button(array( |
| 38 |
'type' => 'a', |
| 39 |
'href' => get_comment_link($comment->comment_ID), |
| 40 |
'class' => 'btn btn-sm btn-outline-primary float-right', |
| 41 |
'icon' => 'fas fa-comments', |
| 42 |
'title' => __( 'View Comment', 'userswp' ), |
| 43 |
'content' => __( 'View Comment', 'userswp' ), |
| 44 |
)); |
| 45 |
|
| 46 |
echo apply_filters('uwp_tp_comments_item_footer', $footer_html,$comment); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 47 |
?> |
| 48 |
</div> |
| 49 |
</div> |