apply_filters( ‘comment_link’, string $comment_permalink )

Filters the current comment’s permalink.

Description

See also

Parameters

$comment_permalinkstring
The current comment permalink.

More Information

The comment_link filter provides the ability to alter the links to post comments in the RSS feed.

When the ‘comment_link’ filter is called, it is passed one parameter: the link.

add_filter( 'comment_link', 'filter_function_name', 10, 3 );

function filter_function_name( $link) {
// Manipulate comment link
return $link;
}

Where ‘filter_function_name’ is the function WordPress should call when the filter is run. Note that the filter function must return a value after it is finished processing or the result will be empty.

filter_function_name should be unique function name. It cannot match any other function name already declared.

Source

echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) );

Changelog

VersionDescription
3.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.