説明なし

comments.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
  3. //Only for AJAX loading posts
  4. if ( ! empty( $comments ) ) {
  5. foreach ( $comments as $comment ) {
  6. UM()->get_template( 'profile/comments-single.php', '', array( 'comment' => $comment ), true );
  7. }
  8. }
  9. } else {
  10. if ( ! empty( $comments ) ) { ?>
  11. <div class="um-ajax-items">
  12. <?php foreach ( $comments as $comment ) {
  13. UM()->get_template( 'profile/comments-single.php', '', array( 'comment' => $comment ), true );
  14. }
  15. if ( $count_comments > 10 ) { ?>
  16. <div class="um-load-items">
  17. <a href="javascript:void(0);" class="um-ajax-paginate um-button" data-hook="um_load_comments"
  18. data-user_id="<?php echo esc_attr( um_get_requested_user() ); ?>" data-page="1"
  19. data-pages="<?php echo esc_attr( ceil( $count_comments / 10 ) ); ?>">
  20. <?php _e( 'load more comments', 'ultimate-member' ); ?>
  21. </a>
  22. </div>
  23. <?php } ?>
  24. </div>
  25. <?php } else { ?>
  26. <div class="um-profile-note">
  27. <span>
  28. <?php if ( um_profile_id() == get_current_user_id() ) {
  29. _e( 'You have not made any comments.', 'ultimate-member' );
  30. } else {
  31. _e( 'This user has not made any comments.', 'ultimate-member' );
  32. } ?>
  33. </span>
  34. </div>
  35. <?php }
  36. }