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_back_to_post() { $defaults = array('icon' => '<img localsrc="64" alt="' . __('<-', 'ktai_style') . '" />', 'anchor' => __('Back to the post', 'ktai_style'), 'accesskey' => '*', 'echo' => true); $r = _ks_parse_arg(func_get_args(), $defaults); if (isset($r['label'])) { $r['anchor'] = $r['label']; } global $post; $output = _ks_internal_link(get_permalink(), $r['accesskey'], $r['anchor'], $post->post_password, $r['icon']); if ($r['echo']) { echo $output; } return $output; }