wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
get_year_link › WordPress Function
Da1.5.0
Deprecaton/a
› get_year_link ( $year )
| Parametri: |
|
| Ritorna: |
|
| Definito a: |
|
| Codex: |
Retrieves the permalink for the year archives.
Sorgenti
function get_year_link( $year ) {
global $wp_rewrite;
if ( ! $year ) {
$year = current_time( 'Y' );
}
$yearlink = $wp_rewrite->get_year_permastruct();
if ( ! empty( $yearlink ) ) {
$yearlink = str_replace( '%year%', $year, $yearlink );
$yearlink = home_url( user_trailingslashit( $yearlink, 'year' ) );
} else {
$yearlink = home_url( '?m=' . $year );
}
/**
* Filters the year archive permalink.
*
* @since 1.5.0
*
* @param string $yearlink Permalink for the year archive.
* @param int $year Year for the archive.
*/
return apply_filters( 'year_link', $yearlink, $year );
}