Forums
Forums / Fixing WordPress / Comment Author Link in New Window
(@andrewkhunn)
16 years, 10 months ago
I was wondering if someone with better PHP-fu than me could help me craft a filter for functions.php to alter get_comment_author_link to open in a new window?
My (likely horrible) best guess follows:
function get_comment_author_link_new() { $url = get_comment_author_url(); $author = get_comment_author(); if (empty( $url ) || 'http://' == $url) $return = $author; else $return = "<a href='$url' rel='external nofollow' class='url' target='_blank'>$author</a>"; return apply_filters('get_comment_author_link_new', $return); } add_filter('get_comment_author_link', 'get_comment_author_link_new');
Solved. I just needed to change:
return apply_filters('get_comment_author_link_new', $return);
to
return $return;
The topic ‘Comment Author Link in New Window’ is closed to new replies.
(@andrewkhunn)
16 years, 10 months ago
I was wondering if someone with better PHP-fu than me could help me craft a filter for functions.php to alter get_comment_author_link to open in a new window?
My (likely horrible) best guess follows: