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
2235  */
2236 function get_calendar( $initial = true, $display = true ) {
2237      global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
2238
2239      $key   = md5( $m . $monthnum . $year );
2240      $cache = wp_cache_get( 'get_calendar', 'calendar' );
2241
2242      if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {
2243           /** This filter is documented in wp-includes/general-template.php */
2244           $output = apply_filters( 'get_calendar', $cache[ $key ] );
2245
2246           if ( $display ) {
2247                echo $output;
2248                return;
2249           }
2250
2251           return $output;
2252      }
2253
 
Line Code
2442
2443      if ( $display ) {
2444           /**
2445            * Filters the HTML calendar output.
2446            *
2447            * @since 3.0.0
2448            *
2449            * @param string $calendar_output HTML output of the calendar.
2450            */
2451           echo apply_filters( 'get_calendar', $calendar_output );
2452           return;
2453      }
2454      /** This filter is documented in wp-includes/general-template.php */
2455      return apply_filters( 'get_calendar', $calendar_output );
2456 }
2457
2458 /**
2459  * Purges the cached results of get_calendar.
2460  *
2461  * @see get_calendar()
2462  * @since 2.1.0
2463  */
2464 function delete_get_calendar_cache() {