Guest User

Example UserPro blog comment integration

a guest
Jun 8th, 2014
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // add UserPro support for comments
  2. function schmoovies_comments($comment, $args, $depth) {
  3.     global $userpro;
  4.     $GLOBALS['comment'] = $comment; ?>     
  5.     <li id="li-comment-<?php comment_ID() ?>">     
  6.        
  7.         <div class="comment <?php echo get_comment_type(); ?>" id="comment-<?php comment_ID() ?>">                     
  8.            
  9.             <?php echo get_avatar( $comment, 60 ); ?>          
  10.                
  11.             <h5><?php if ($comment->user_id) { ?>
  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 } ?>
  16.             </h5>
  17.             <span class="date"><?php comment_date(); ?></span>
  18.                
  19.             <?php if ($comment->comment_approved == '0') : ?>
  20.                 <p><span class="message"><?php _e('Your comment is awaiting moderation.', 'themetrust'); ?></span></p>
  21.             <?php endif; ?>
  22.                
  23.             <?php comment_text() ?>            
  24.                
  25.             <?php
  26.             if(get_comment_type() != "trackback")
  27.                 comment_reply_link(array_merge( $args, array('add_below' => 'comment','reply_text' => '<span>'. __('Reply', 'themetrust') .'</span>', 'login_text' => '<span>'. __('Log in to reply', 'themetrust') .'</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'])))
  28.            
  29.             ?>
  30.                
  31.         </div><!-- end comment -->
  32.            
  33. <?php
  34. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×