Filter hook 'get_comment_author_url'

in WP Core File wp-includes/comment-template.php at line 381

View Source

get_comment_author_url

Filter Hook
Description
Filters the comment author's URL.

Hook Information

File Location wp-includes/comment-template.php View on GitHub
Hook Type Filter
Line Number 381

Hook Parameters

Type Name Description
string $comment_author_url The comment author's URL, or an empty string.
string|int $comment_id The comment ID as a numeric string, or 0 if not found.
WP_Comment|null $comment The comment object, or null if not found.

Usage Examples

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

function my_custom_filter($comment_author_url, $comment_id, $comment) {
    // Your custom filtering logic here
    return $comment_author_url;
}

Source Code Context

wp-includes/comment-template.php:381 - How this hook is used in WordPress core
<?php
 376  	 *
 377  	 * @param string          $comment_author_url The comment author's URL, or an empty string.
 378  	 * @param string|int      $comment_id         The comment ID as a numeric string, or 0 if not found.
 379  	 * @param WP_Comment|null $comment            The comment object, or null if not found.
 380  	 */
 381  	return apply_filters( 'get_comment_author_url', $comment_author_url, $comment_id, $comment );
 382  }
 383  
 384  /**
 385   * Displays the URL of the author of the current comment, not linked.
 386   *

PHP Documentation

<?php
/**
	 * Filters the comment author's URL.
	 *
	 * @since 1.5.0
	 * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
	 *
	 * @param string          $comment_author_url The comment author's URL, or an empty string.
	 * @param string|int      $comment_id         The comment ID as a numeric string, or 0 if not found.
	 * @param WP_Comment|null $comment            The comment object, or null if not found.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.