author_link
author_link is a filter on links generated that point to each author's archives.
Context:
File: wp-includes/template-functions-author.php
function get_author_link($echo = false, $author_id, $author_nicename) {
global $wpdb, $wp_rewrite, $post, $cache_userdata;
$auth_ID = $author_id;
$link = $wp_rewrite->get_author_permastruct();
if (empty($link)) {
$file = get_settings('home') . '/';
$link = $file . '?author=' . $auth_ID;
} else {
if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename;
$link = str_replace('%author%', $author_nicename, $link);
$link = get_settings('home') . trailingslashit($link);
}
$link = apply_filters('author_link', $link, $author_id, $author_nicename);
if ($echo) echo $link;
return $link;
}
This hook can pass multiple parameters. In order to get additional parameters (up to 3 for this hook) passed to your function, you will have to hook in like this: add_filter('author_link', 'your_function', 10, 3); where 10 is your function's priority, and 3 is the number of parameters you want your function to accept. Note that your function should only return the first parameter.
This hook is a filter which means that information is passed through it, and then used by WordPress. Your function needs to accept that information, and return it. Using add_filter('author_link', 'your_function'); helps you to remember this distinction. When you are passing an ID, it is assumed that you will return the ID as it was given to you. With filters that pass strings or arrays, you may manipulate the information before passing it along.