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
2062  */
2063 function get_calendar( $initial = true, $echo = true ) {
2064      global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
2065
2066      $key   = md5( $m . $monthnum . $year );
2067      $cache = wp_cache_get( 'get_calendar', 'calendar' );
2068
2069      if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {
2070           /** This filter is documented in wp-includes/general-template.php */
2071           $output = apply_filters( 'get_calendar', $cache[ $key ] );
2072
2073           if ( $echo ) {
2074                echo $output;
2075                return;
2076           }
2077
2078           return $output;
2079      }
2080
 
Line Code
2266
2267      if ( $echo ) {
2268           /**
2269            * Filters the HTML calendar output.
2270            *
2271            * @since 3.0.0
2272            *
2273            * @param string $calendar_output HTML output of the calendar.
2274            */
2275           echo apply_filters( 'get_calendar', $calendar_output );
2276           return;
2277      }
2278      /** This filter is documented in wp-includes/general-template.php */
2279      return apply_filters( 'get_calendar', $calendar_output );
2280 }
2281
2282 /**
2283  * Purge the cached results of get_calendar.
2284  *
2285  * @see get_calendar
2286  * @since 2.1.0
2287  */
2288 function delete_get_calendar_cache() {