get_comment_author_link
Filter HookDescription
Filters the comment author's link for display.Hook Information
File Location |
wp-includes/comment-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 293 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$comment_author_link
|
The HTML-formatted comment author link. Empty for an invalid URL. |
string
|
$comment_author
|
The comment author's username. |
string
|
$comment_id
|
The comment ID as a numeric string. |
Usage Examples
Basic Usage
<?php
// Hook into get_comment_author_link
add_filter('get_comment_author_link', 'my_custom_filter', 10, 3);
function my_custom_filter($comment_author_link, $comment_author, $comment_id) {
// Your custom filtering logic here
return $comment_author_link;
}
Source Code Context
wp-includes/comment-template.php:293
- How this hook is used in WordPress core
<?php
288 * @param string $comment_author_link The HTML-formatted comment author link.
289 * Empty for an invalid URL.
290 * @param string $comment_author The comment author's username.
291 * @param string $comment_id The comment ID as a numeric string.
292 */
293 return apply_filters( 'get_comment_author_link', $comment_author_link, $comment_author, $comment_id );
294 }
295
296 /**
297 * Displays the HTML link to the URL of the author of the current comment.
298 *
PHP Documentation
<?php
/**
* Filters the comment author's link for display.
*
* @since 1.5.0
* @since 4.1.0 The `$comment_author` and `$comment_id` parameters were added.
*
* @param string $comment_author_link The HTML-formatted comment author link.
* Empty for an invalid URL.
* @param string $comment_author The comment author's username.
* @param string $comment_id The comment ID as a numeric string.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/comment-template.php
Related Hooks
Related hooks will be displayed here in future updates.