WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 360 | global $wp_rewrite; |
| 361 | if ( !$year ) |
| 362 | $year = gmdate('Y', current_time('timestamp')); |
| 363 | if ( !$month ) |
| 364 | $month = gmdate('m', current_time('timestamp')); |
| 365 | $monthlink = $wp_rewrite->get_month_permastruct(); |
| 366 | if ( !empty($monthlink) ) { |
| 367 | $monthlink = str_replace('%year%', $year, $monthlink); |
| 368 | $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); |
| 369 | return apply_filters('month_link', home_url( user_trailingslashit($monthlink, 'month') ), $year, $month); |
| 370 | } else { |
| 371 | return apply_filters('month_link', home_url( '?m=' . $year . zeroise($month, 2) ), $year, $month); |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | /** |
| 376 | * Retrieve the permalink for the day archives with year and month. |
| 377 | * |
| 378 | * @since 1.0.0 |
| 379 | * |
| 380 | * @param bool|int $year False for current year. Integer of year. |