Files
ultimatemember/templates/profile/comments-single.php
T

39 lines
1.4 KiB
PHP
Raw Normal View History

2018-12-05 10:50:08 +02:00
<?php if ( ! defined( 'ABSPATH' ) ) exit;
2018-12-05 10:50:08 +02:00
foreach ( UM()->shortcodes()->loop as $comment ) {
2018-12-05 10:50:08 +02:00
$post_type = get_post_type( $comment->comment_post_ID );
if ( $post_type == 'um_groups_discussion' ) {
$comment_id = $comment->comment_post_ID;
$group_id = get_post_meta( $comment_id, '_group_id', true );
$comment_title = get_the_title( $group_id );
$link = site_url() . '/groups/' . $comment_title . '/?tab=discussion#commentid-' . $comment_id;
} else {
$comment_title = get_the_title( $comment->comment_post_ID );
$link = get_permalink( $comment->comment_post_ID );
} ?>
2018-12-05 10:50:08 +02:00
<div class="um-item">
<div class="um-item-link">
<i class="um-icon-chatboxes"></i>
2019-07-16 18:40:07 +03:00
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
2019-07-22 12:44:58 +03:00
<?php echo get_comment_excerpt( $comment->comment_ID ); ?>
2018-12-05 10:50:08 +02:00
</a>
</div>
<div class="um-item-meta">
<span><?php printf( __( 'On <a href="%1$s">%2$s</a>','ultimate-member' ), $link, $comment_title ); ?></span>
2015-02-01 01:30:04 +02:00
</div>
2018-12-05 10:50:08 +02:00
</div>
<?php }
if ( isset( UM()->shortcodes()->modified_args ) && count( UM()->shortcodes()->loop ) >= 10 ) { ?>
2018-12-05 10:50:08 +02:00
<div class="um-load-items">
<a href="javascript:void(0);" class="um-ajax-paginate um-button" data-hook="um_load_comments"
data-args="<?php echo esc_attr( UM()->shortcodes()->modified_args ); ?>">
<?php _e( 'load more comments', 'ultimate-member' ); ?>
2018-12-05 10:50:08 +02:00
</a>
</div>
2018-12-05 10:50:08 +02:00
<?php }