xefned

Elegant Theme's Divi theme functions.php with UserPro integr

May 27th, 2014
270
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php if ( ! function_exists( 'et_custom_comments_display' ) ) :
  2. function et_custom_comments_display($comment, $args, $depth) {
  3. $GLOBALS['comment'] = $comment;
  4. global $userpro; ?>
  5. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
  6. <article id="comment-<?php comment_ID(); ?>" class="comment-body clearfix">
  7. <div class="comment_avatar">
  8. <?php echo get_avatar( $comment, $size = '80' ); ?>
  9. </div>
  10.  
  11. <div class="comment_postinfo">
  12. <?php printf( '<cite class="fn">%s</cite>', '<a href="'.$userpro->permalink( $comment->user_id ).'">'.userpro_profile_data('display_name', $comment->user_id) . '</a>'); ?>
  13. <?php } else { ?>
  14. <?php printf( '<cite class="fn">%s</cite>', get_comment_author_link() ); ?>
  15. <?php } echo userpro_show_badges( $comment->user_id, $inline=true ); ?>
  16.  
  17. <span class="comment_date">
  18. <?php
  19. /* translators: 1: date, 2: time */
  20. printf( __( 'on %1$s at %2$s', 'Divi' ), get_comment_date(), get_comment_time() );
  21. ?>
  22. </span>
  23. <?php edit_comment_link( esc_html__( '(Edit)', 'Divi' ), ' ' ); ?>
  24. <?php
  25. $et_comment_reply_link = get_comment_reply_link( array_merge( $args, array(
  26. 'reply_text' => esc_attr__( 'Reply', 'Divi' ),
  27. 'depth' => (int) $depth,
  28. 'max_depth' => (int) $args['max_depth'],
  29. ) ) );
  30. ?>
  31. </div> <!-- .comment_postinfo -->
  32.  
  33. <div class="comment_area">
  34. <?php if ( '0' == $comment->comment_approved ) : ?>
  35. <em class="moderation"><?php esc_html_e('Your comment is awaiting moderation.','Divi') ?></em>
  36. <br />
  37. <?php endif; ?>
  38.  
  39. <div class="comment-content clearfix">
  40. <?php
  41. comment_text();
  42. if ( $et_comment_reply_link ) echo '<span class="reply-container">' . $et_comment_reply_link . '</span>';
  43. ?>
  44. </div> <!-- end comment-content-->
  45. </div> <!-- end comment_area-->
  46. </article> <!-- .comment-body -->
  47. <?php }
  48. endif;
RAW Paste Data