Filter hook 'the_author_link'

in WP Core File wp-includes/author-template.php at line 257

View Source

the_author_link

Filter Hook
Description
Filters the author URL link HTML.

Hook Information

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

Hook Parameters

Type Name Description
string $link The default rendered author HTML link.
string $author_url Author's URL.
WP_User $authordata Author user data.

Usage Examples

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

function my_custom_filter($link, $author_url, $authordata) {
    // Your custom filtering logic here
    return $link;
}

Source Code Context

wp-includes/author-template.php:257 - How this hook is used in WordPress core
<?php
 252  		 *
 253  		 * @param string  $link       The default rendered author HTML link.
 254  		 * @param string  $author_url Author's URL.
 255  		 * @param WP_User $authordata Author user data.
 256  		 */
 257  		return apply_filters( 'the_author_link', $link, $author_url, $authordata );
 258  	} else {
 259  		return get_the_author();
 260  	}
 261  }
 262  

PHP Documentation

<?php
/**
		 * Filters the author URL link HTML.
		 *
		 * @since 6.0.0
		 *
		 * @param string  $link       The default rendered author HTML link.
		 * @param string  $author_url Author's URL.
		 * @param WP_User $authordata Author user data.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/author-template.php
Related Hooks

Related hooks will be displayed here in future updates.