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

Line Code
2329           'week'     => $w,
2330      );
2331
2332      wp_recursive_ksort( $cache_args );
2333      $key   = md5( serialize( $cache_args ) );
2334      $cache = wp_cache_get( 'get_calendar', 'calendar' );
2335
2336      if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {
2337           /** This filter is documented in wp-includes/general-template.php */
2338           $output = apply_filters( 'get_calendar', $cache[ $key ], $args );
2339
2340           if ( $args['display'] ) {
2341                echo $output;
2342                return;
2343           }
2344
2345           return $output;
2346      }
2347
 
Line Code
2584       * @param string $calendar_output HTML output of the calendar.
2585       * @param array  $args {
2586       *     Optional. Array of display arguments.
2587       *
2588       *     @type bool   $initial   Whether to use initial calendar names. Default true.
2589       *     @type bool   $display   Whether to display the calendar output. Default true.
2590       *     @type string $post_type Optional. Post type. Default 'post'.
2591       * }
2592       */
2593      $calendar_output = apply_filters( 'get_calendar', $calendar_output, $args );
2594
2595      if ( $args['display'] ) {
2596           echo $calendar_output;
2597           return;
2598      }
2599
2600      return $calendar_output;
2601 }
2602