McLaren 3 Posting Whiz in Training

Hi,

I cannot figure out why it does not call my overriden function. The original function is in wp-include/comment-template.php file.

In my theme there is file functions.php so I put this code to override the original function:

add_filter('get_comment_reply_link', 'mano_get_comment_reply_link', 1, 3);

function mano_get_comment_reply_link($args = array(), $comment = null, $post = null) {
	
	echo 'override';

	global $user_ID;
	
	$defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Atsakyti'),
		'login_text' => __('Log in to Reply'), 'depth' => 0, 'before' => '', 'after' => '');

	$args = wp_parse_args($args, $defaults);

	if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] )
		return;

	extract($args, EXTR_SKIP);

	$comment = get_comment($comment);
	if ( empty($post) )
		$post = $comment->comment_post_ID;
	$post = get_post($post);

	if ( !comments_open($post->ID) )
		return false;

	$link = '';

	if ( get_option('comment_registration') && !$user_ID )
		$link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
	else
		$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>";
	return apply_filters('mano_comment_reply_link', $before . $link . $after, $args, $comment, $post);
}

Have you an idea why it does not get called? WHat I want to do is to translate teh link - replay.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.