钩子文档

get_calendar

💡 云策文档标注

概述

get_calendar 是一个 WordPress 过滤器,用于修改日历的 HTML 输出。它允许开发者自定义日历的显示内容和行为。

关键要点

  • 过滤器名称:get_calendar
  • 参数:$calendar_output(HTML 输出字符串)、$args(显示参数数组)
  • 用途:过滤日历的 HTML 输出,支持自定义显示
  • 相关函数:get_calendar() 用于显示日历

代码示例

$calendar_output = apply_filters( 'get_calendar', $calendar_output, $args );

📄 原文内容

Filters the HTML calendar output.

Parameters

$calendar_outputstring
HTML output of the calendar.
$argsarray
Array of display arguments.

  • initial bool
    Whether to use initial calendar names. Default true.
  • display bool
    Whether to display the calendar output. Default true.
  • post_type string
    Optional. Post type. Default 'post'.

Source

$calendar_output = apply_filters( 'get_calendar', $calendar_output, $args );

Changelog

Version Description
6.8.0 Added the $args parameter.
3.0.0 Introduced.