wppaste
WordPress

get_calendar( array $args = array() ): void|string

Since
1.0.0, 6.8.0
Source
wp-includes/general-template.php:2477
Displays calendar with days that have posts as links.

Description

The calendar is cached, which will be retrieved, if it exists. If there are no posts for the month, then it will not be displayed.

Compatibility

WordPress
since 6.8.0
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Parameters

$argsarrayoptional
Arguments for the get_calendar function.Default: array()
  • $initialbooldefault: true

    Whether to use initial calendar names.
  • $displaybooldefault: true

    Whether to display the calendar output.
  • $post_typestringdefault: 'post'

    Optional. Post type.

Return value

void|string
Void if $display argument is true, calendar HTML if $display is false.

Performance profile

How much work a call to get_calendar() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Heavy

Reaches the database via ->get_row().

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
256–323

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 553.

Plugin surface
2 hooks

Third-party callbacks on 'get_calendar_args', 'get_calendar' run inside this call, and their cost is not bounded by anything here.

Called by
2

2 places in core call this, so the cost is paid more often than your own code shows.

What it touches

  • hookthird-party callbacksapply_filters()called directly
  • cacheobject cachewp_cache_get()called directly
  • optionoption read or writeget_option()called directly
  • serializeserialisationserialize()called directly
  • sqldatabase query->get_row()called directly

Further down the call graph this can also reach query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 24 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost get_calendar() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$pad && !$day256–264wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$pad && !$day258–265wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$day262–270wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$day264–271wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$day264–270wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$day266–271wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && $pad && !$day270–276wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && $pad && !$day272–277wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$pad && !$day279–287wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$pad && !$day281–288wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$day285–293wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$day287–294wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
12 further outcomes, up to 323 instructions
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$day287–293wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$day289–294wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && $pad && !$day293–299wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && $pad && !$day295–300wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$pad && !$day302–310wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$pad && !$day304–311wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$day308–316wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$day310–317wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && !$day310–316wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && !$day312–317wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && empty($m) && !$wdcount && $pad && !$day316–322wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), current_time(), current_time(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()
empty($original_args) && post_type_exists() && !isset($value) && is_array($cache) && empty($monthnum) && empty($w) && !empty($m) && !$wdcount && $pad && !$day318–323wp_parse_args(), apply_filters(), post_type_exists(), wp_recursive_ksort(), serialize(), md5(), wp_cache_get(), get_option(), mktime(), gmdate(), zeroise(), ->prepare(), ->get_row(), zeroise(), ->prepare(), ->get_row(), _x(), ->get_month(), gmdate(), sprintf(), zeroise(), zeroise(), ->prepare(), ->get_results(), gmdate(), calendar_week_mod(), esc_attr(), gmdate(), mktime(), gmdate(), calendar_week_mod(), esc_attr(), __(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), get_month_link(), ->get_month(), ->get_month_abbrev(), sprintf(), wp_cache_set(), apply_filters()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev551256–323402 fewer instructions than PHP 8.5
8.5553256–32340
8.4553256–3234011 fewer instructions than PHP 8.3
8.3564256–32940
8.2564256–32940
8.1564256–32940
7.4564256–32940

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Hooks and filters fired · 3

3 hooks fire while get_calendar() runs, in this order:

  1. apply_filters( get_calendar_args )filterline 2515 (+38 into the body)

    Filter the `get_calendar` function arguments before they are used.

  2. apply_filters( get_calendar )filterline 2554 (+77 into the body)

    Filters the HTML calendar output.

  3. apply_filters( get_calendar )filterline 2809 (+332 into the body)

    Filters the HTML calendar output.

Uses · 15

Show all 15
  • __()Retrieves the translation of $text.
  • get_day_link()Retrieves the permalink for the day archives with year and month.
  • get_month_link()Retrieves the permalink for the month archives with year.

Used by · 2

Source code

function get_calendar( $args = array() ) {	global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; 	$defaults = array(		'initial'   => true,		'display'   => true,		'post_type' => 'post',	); 	$original_args = func_get_args();	$args          = array(); 	if ( ! empty( $original_args ) ) {		if ( ! is_array( $original_args[0] ) ) {			if ( isset( $original_args[0] ) && is_bool( $original_args[0] ) ) {				$defaults['initial'] = $original_args[0];			}			if ( isset( $original_args[1] ) && is_bool( $original_args[1] ) ) {				$defaults['display'] = $original_args[1];			}		} else {			$args = $original_args[0];		}	} 	/**	 * Filter the `get_calendar` function arguments before they are used.	 *	 * @since 6.8.0	 *	 * @param array $args {	 *     Optional. Arguments for the `get_calendar` function.	 *	 *     @type bool   $initial   Whether to use initial calendar names. Default true.	 *     @type bool   $display   Whether to display the calendar output. Default true.	 *     @type string $post_type Optional. Post type. Default 'post'.	 * }	 */	$args = apply_filters( 'get_calendar_args', wp_parse_args( $args, $defaults ) ); 	if ( ! post_type_exists( $args['post_type'] ) ) {		$args['post_type'] = 'post';	} 	$w = 0;	if ( isset( $_GET['w'] ) ) {		$w = (int) $_GET['w'];	} 	/*	 * Normalize the cache key.	 *	 * The following ensures the same cache key is used for the same parameter	 * and parameter equivalents. This prevents `post_type > post, initial > true`	 * from generating a different key from the same values in the reverse order.	 *	 * `display` is excluded from the cache key as the cache contains the same	 * HTML regardless of this function's need to echo or return the output.	 *	 * The global values contain data generated by the URL query string variables.	 */	$cache_args = $args;	unset( $cache_args['display'] ); 	$cache_args['globals'] = array(		'm'        => $m,		'monthnum' => $monthnum,		'year'     => $year,		'week'     => $w,	); 	wp_recursive_ksort( $cache_args );	$key   = md5( serialize( $cache_args ) );	$cache = wp_cache_get( 'get_calendar', 'calendar' ); 	if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {		/** This filter is documented in wp-includes/general-template.php */		$output = apply_filters( 'get_calendar', $cache[ $key ], $args ); 		if ( $args['display'] ) {

Changelog

Introduced in 1.0.0. 3 changes between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.8.8
Parameter $args added.verified against source
6.8.8
Parameter $initial removed.verified against source
6.8.8
Parameter $display removed.verified against source
6.8.0
Added the $args parameter, with backward compatibility for the replaced $initial and $display parameters.from the docblock
1.0.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.