Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_calendar

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 3 times in this file.

Line Code
1867  */
1868 function get_calendar( $initial = true, $echo = true ) {
1869      global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
1870
1871      $key = md5( $m . $monthnum . $year );
1872      $cache = wp_cache_get( 'get_calendar', 'calendar' );
1873
1874      if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {
1875           /** This filter is documented in wp-includes/general-template.php */
1876           $output = apply_filters( 'get_calendar', $cache[ $key ] );
1877
1878           if ( $echo ) {
1879                echo $output;
1880                return;
1881           }
1882
1883           return $output;
1884      }
1885
 
Line Code
2065
2066      if ( $echo ) {
2067           /**
2068            * Filter the HTML calendar output.
2069            *
2070            * @since 3.0.0
2071            *
2072            * @param string $calendar_output HTML output of the calendar.
2073            */
2074           echo apply_filters( 'get_calendar', $calendar_output );
2075           return;
2076      }
2077      /** This filter is documented in wp-includes/general-template.php */
2078      return apply_filters( 'get_calendar', $calendar_output );
2079 }
2080
2081 /**
2082  * Purge the cached results of get_calendar.
2083  *
2084  * @see get_calendar
2085  * @since 2.1.0
2086  */
2087 function delete_get_calendar_cache() {