Filter hook 'get_calendar'

in WP Core File wp-includes/general-template.php at line 2588

View Source

get_calendar

Filter Hook
Description
Filters the HTML calendar output. }

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 2588

Hook Parameters

Type Name Description
string $calendar_output HTML output of the calendar.
array $args { Optional. Array of display arguments.

Usage Examples

Basic Usage
<?php
// Hook into get_calendar
add_filter('get_calendar', 'my_custom_filter', 10, 2);

function my_custom_filter($calendar_output, $args) {
    // Your custom filtering logic here
    return $calendar_output;
}

Source Code Context

wp-includes/general-template.php:2588 - How this hook is used in WordPress core
<?php
2583  	 *     @type bool   $initial   Whether to use initial calendar names. Default true.
2584  	 *     @type bool   $display   Whether to display the calendar output. Default true.
2585  	 *     @type string $post_type Optional. Post type. Default 'post'.
2586  	 * }
2587  	 */
2588  	$calendar_output = apply_filters( 'get_calendar', $calendar_output, $args );
2589  
2590  	if ( $args['display'] ) {
2591  		echo $calendar_output;
2592  		return;
2593  	}

PHP Documentation

<?php
/**
	 * Filters the HTML calendar output.
	 *
	 * @since 3.0.0
	 * @since 6.8.0 Added the `$args` parameter.
	 *
	 * @param string $calendar_output HTML output of the calendar.
	 * @param array  $args {
	 *     Optional. Array of display arguments.
	 *
	 *     @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'.
	 * }
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.