year_link
Filters the year archive permalink.
Usage
add_filter( 'year_link', 'wp_kama_year_link_filter', 10, 2 );
/**
* Function for `year_link` filter-hook.
*
* @param string $yearlink Permalink for the year archive.
* @param int $year Year for the archive.
*
* @return string
*/
function wp_kama_year_link_filter( $yearlink, $year ){
// filter...
return $yearlink;
}
- $yearlink(string)
- Permalink for the year archive.
- $year(int)
- Year for the archive.
Changelog
| Since 1.5.0 | Introduced. |
Where the hook is called
year_link
wp-includes/link-template.php 568
return apply_filters( 'year_link', $yearlink, $year );