get_calendar_args
Filter HookDescription
Filter the `get_calendar` function arguments before they are used. }Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2294 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$args
|
{ Optional. Arguments for the `get_calendar` function. |
Usage Examples
Basic Usage
<?php
// Hook into get_calendar_args
add_filter('get_calendar_args', 'my_custom_filter', 10, 1);
function my_custom_filter($args) {
// Your custom filtering logic here
return $args;
}
Source Code Context
wp-includes/general-template.php:2294
- How this hook is used in WordPress core
<?php
2289 * @type bool $display Whether to display the calendar output. Default true.
2290 * @type string $post_type Optional. Post type. Default 'post'.
2291 * }
2292 * @return array The arguments for the `get_calendar` function.
2293 */
2294 $args = apply_filters( 'get_calendar_args', wp_parse_args( $args, $defaults ) );
2295
2296 if ( ! post_type_exists( $args['post_type'] ) ) {
2297 $args['post_type'] = 'post';
2298 }
2299
PHP Documentation
<?php
/**
* 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'.
* }
* @return array The arguments for the `get_calendar` function.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.