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
1970  */
1971 function get_calendar( $initial = true, $echo = true ) {
1972      global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
1973
1974      $key   = md5( $m . $monthnum . $year );
1975      $cache = wp_cache_get( 'get_calendar', 'calendar' );
1976
1977      if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {
1978           /** This filter is documented in wp-includes/general-template.php */
1979           $output = apply_filters( 'get_calendar', $cache[ $key ] );
1980
1981           if ( $echo ) {
1982                echo $output;
1983                return;
1984           }
1985
1986           return $output;
1987      }
1988
 
Line Code
2176
2177      if ( $echo ) {
2178           /**
2179            * Filters the HTML calendar output.
2180            *
2181            * @since 3.0.0
2182            *
2183            * @param string $calendar_output HTML output of the calendar.
2184            */
2185           echo apply_filters( 'get_calendar', $calendar_output );
2186           return;
2187      }
2188      /** This filter is documented in wp-includes/general-template.php */
2189      return apply_filters( 'get_calendar', $calendar_output );
2190 }
2191
2192 /**
2193  * Purge the cached results of get_calendar.
2194  *
2195  * @see get_calendar
2196  * @since 2.1.0
2197  */
2198 function delete_get_calendar_cache() {