| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
$the_query = isset( $args['template_args']['the_query'] ) ? $args['template_args']['the_query'] : ''; |
| 8 |
$maximum_pages = isset( $args['template_args']['maximum_pages'] ) ? $args['template_args']['maximum_pages'] : ''; |
| 9 |
$title = isset( $args['template_args']['title'] ) ? $args['template_args']['title'] : __('Comments', 'userswp'); |
| 10 |
?> |
| 11 |
<h3><?php echo esc_attr( $title );?></h3> |
| 12 |
|
| 13 |
<div class="uwp-profile-item-block"> |
| 14 |
<?php |
| 15 |
// The Loop |
| 16 |
if ($the_query) { |
| 17 |
echo '<ul class="uwp-profile-item-ul">'; |
| 18 |
foreach ( $the_query as $comment ) { |
| 19 |
$args['template_args']['comment'] = $comment; |
| 20 |
uwp_get_template("comments-item.php", $args); |
| 21 |
?> |
| 22 |
|
| 23 |
<?php |
| 24 |
} |
| 25 |
echo '</ul>'; |
| 26 |
} else { |
| 27 |
// no comments found |
| 28 |
echo "<p>".esc_html__('No comments found', 'userswp')."</p>"; |
| 29 |
} |
| 30 |
|
| 31 |
do_action('uwp_profile_pagination', $maximum_pages); |
| 32 |
?> |
| 33 |
</div> |