| 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-comments-loop"> |
| 14 |
<?php |
| 15 |
// The Loop |
| 16 |
if ($the_query) { |
| 17 |
$template = "bootstrap/comments-item.php"; |
| 18 |
echo '<div class="cards">'; |
| 19 |
foreach ( $the_query as $comment ) { |
| 20 |
$args['template_args']['comment'] = $comment; |
| 21 |
uwp_get_template($template, $args); |
| 22 |
} |
| 23 |
echo '</div>'; |
| 24 |
} else { |
| 25 |
// no comments found |
| 26 |
echo aui()->alert(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 27 |
'type'=>'info', |
| 28 |
'content'=> esc_html( sprintf(__('No %s found', 'userswp'), strtolower($title)) ) |
| 29 |
)); |
| 30 |
} |
| 31 |
do_action('uwp_profile_pagination', $maximum_pages); |
| 32 |
?> |
| 33 |
</div> |