comment_author_link_rel
Filter HookDescription
Filters the rel attributes of the comment author's link.Hook Information
File Location |
wp-includes/comment-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 267 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$rel_parts
|
An array of strings representing the rel tags which will be joined into the anchor's rel attribute. |
WP_Comment
|
$comment
|
The comment object. |
Usage Examples
Basic Usage
<?php
// Hook into comment_author_link_rel
add_filter('comment_author_link_rel', 'my_custom_filter', 10, 2);
function my_custom_filter($rel_parts, $comment) {
// Your custom filtering logic here
return $rel_parts;
}
Source Code Context
wp-includes/comment-template.php:267
- How this hook is used in WordPress core
<?php
262 *
263 * @param string[] $rel_parts An array of strings representing the rel tags
264 * which will be joined into the anchor's rel attribute.
265 * @param WP_Comment $comment The comment object.
266 */
267 $rel_parts = apply_filters( 'comment_author_link_rel', $rel_parts, $comment );
268
269 $rel = implode( ' ', $rel_parts );
270 $rel = esc_attr( $rel );
271 // Empty space before 'rel' is necessary for later sprintf().
272 $rel = ! empty( $rel ) ? sprintf( ' rel="%s"', $rel ) : '';
PHP Documentation
<?php
/**
* Filters the rel attributes of the comment author's link.
*
* @since 6.2.0
*
* @param string[] $rel_parts An array of strings representing the rel tags
* which will be joined into the anchor's rel attribute.
* @param WP_Comment $comment The comment object.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/comment-template.php
Related Hooks
Related hooks will be displayed here in future updates.