Filter hook 'comment_link'

in WP Core File wp-includes/feed.php at line 319

View Source

comment_link

Filter Hook
Description
Filters the current comment's permalink.

Hook Information

File Location wp-includes/feed.php View on GitHub
Hook Type Filter
Line Number 319

Hook Parameters

Type Name Description
string $comment_permalink The current comment permalink.

Usage Examples

Basic Usage
<?php
// Hook into comment_link
add_filter('comment_link', 'my_custom_filter', 10, 1);

function my_custom_filter($comment_permalink) {
    // Your custom filtering logic here
    return $comment_permalink;
}

Source Code Context

wp-includes/feed.php:319 - How this hook is used in WordPress core
<?php
 314  	 *
 315  	 * @see get_comment_link()
 316  	 *
 317  	 * @param string $comment_permalink The current comment permalink.
 318  	 */
 319  	echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) );
 320  }
 321  
 322  /**
 323   * Retrieves the current comment author for use in the feeds.
 324   *

PHP Documentation

<?php
/**
	 * Filters the current comment's permalink.
	 *
	 * @since 3.6.0
	 *
	 * @see get_comment_link()
	 *
	 * @param string $comment_permalink The current comment permalink.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/feed.php
Related Hooks

Related hooks will be displayed here in future updates.