get_calendar
Filters the HTML calendar output.
Использование
add_filter( 'get_calendar', 'wp_kama_get_calendar_filter', 10, 2 );
/**
* Function for `get_calendar` filter-hook.
*
* @param string $calendar_output HTML output of the calendar.
* @param array $args Optional. Array of display arguments.
*
* @return string
*/
function wp_kama_get_calendar_filter( $calendar_output, $args ){
// filter...
return $calendar_output;
}
- $calendar_output(строка)
- HTML output of the calendar.
- $args(массив)
Optional. Array of display arguments.
-
initial(true|false)
Whether to use initial calendar names.
По умолчанию: true -
display(true|false)
Whether to display the calendar output.
По умолчанию: true - post_type(строка)
Optional. Post type.
По умолчанию: 'post'
-
Список изменений
| С версии 3.0.0 | Введена. |
| С версии 6.8.0 | Added the $args parameter. |
Где вызывается хук
get_calendar
wp-includes/general-template.php 2593
$calendar_output = apply_filters( 'get_calendar', $calendar_output, $args );
wp-includes/general-template.php 2338
$output = apply_filters( 'get_calendar', $cache[ $key ], $args );