Advertisement
Guest User

Untitled

a guest
Dec 8th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. add_filter('get_comment_reply_link', 'mano_get_comment_reply_link', 1, 3);
  2.  
  3. function mano_get_comment_reply_link($args = array(), $comment = null, $post = null) {
  4.    
  5.     echo 'override';
  6.  
  7.     global $user_ID;
  8.    
  9.     $defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Atsakyti'),
  10.         'login_text' => __('Log in to Reply'), 'depth' => 0, 'before' => '', 'after' => '');
  11.  
  12.     $args = wp_parse_args($args, $defaults);
  13.  
  14.     if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] )
  15.         return;
  16.  
  17.     extract($args, EXTR_SKIP);
  18.  
  19.     $comment = get_comment($comment);
  20.     if ( empty($post) )
  21.         $post = $comment->comment_post_ID;
  22.     $post = get_post($post);
  23.  
  24.     if ( !comments_open($post->ID) )
  25.         return false;
  26.  
  27.     $link = '';
  28.  
  29.     if ( get_option('comment_registration') && !$user_ID )
  30.         $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
  31.     else
  32.         $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
  33.     return apply_filters('mano_comment_reply_link', $before . $link . $after, $args, $comment, $post);
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement