public function fix_comment_reply_link($link, $args, $comment, $post) { $reply_url = add_query_arg('replytocom', $comment->comment_ID, ks_comments_post_url($post->ID)); if (strpos($link, 'wp-login.php?redirect_to=')) { $url = ks_get_login_url(KTAI_NOT_ECHO, $reply_url); if ($url) { $link = $args['before'] . '<a href="' . esc_url($url) . '">' . $args['login_text'] . '</a>' . $args['after']; } else { $link = ''; } } elseif ($post->post_password && !ks_post_password_required($post)) { if (preg_match('!<img localsrc="\\w+"[^>]*?>!s', $args['reply_text'], $icon)) { // <?php /* syntax hilighting fix */ $icon = $icon[0]; $reply_text = strip_tags($args['reply_text']); } else { $icon = ''; $reply_text = strip_tags($args['reply_text']); } $link = _ks_internal_link($reply_url, '', $reply_text, $post->post_password, $args['before'] . $icon, $args['after']); } else { $link = $args['before'] . '<a href="' . esc_url($reply_url) . '">' . $args['reply_text'] . '</a>' . $args['after']; } return $link; }
function ks_comments_post_link() { if (!comments_open()) { return; } $defaults = array('anchor' => __('Post comments', 'ktai_style'), 'before' => '', 'after' => '', 'icon' => '<img localsrc="149" alt="" />', 'accesskey' => NULL, 'echo' => true); $r = _ks_parse_arg(func_get_args(), $defaults); if (isset($r['label'])) { $r['anchor'] = $r['label']; } $post_url = ks_comments_post_url(); global $post; $post_pass = ks_post_password_required($post) ? NULL : $post->post_password; $output = $r['before'] . _ks_internal_link($post_url, $r['accesskey'], $r['anchor'], $post_pass, $r['icon']) . $r['after']; if ($r['echo']) { echo $output; } return $output; }