Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: day_link

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
394           $month = gmdate('m', current_time('timestamp'));
395      if ( !$day )
396           $day = gmdate('j', current_time('timestamp'));
397
398      $daylink = $wp_rewrite->get_day_permastruct();
399      if ( !empty($daylink) ) {
400           $daylink = str_replace('%year%', $year, $daylink);
401           $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
402           $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
403           return apply_filters('day_link', home_url( user_trailingslashit($daylink, 'day') ), $year, $month, $day);
404      } else {
405           return apply_filters('day_link', home_url( '?m=' . $year . zeroise($month, 2) . zeroise($day, 2) ), $year, $month, $day);
406      }
407 }
408
409 /**
410  * Display the permalink for the feed type.
411  *
412  * @since 3.0.0
413  *
414  * @param string $anchor The link's anchor text.